當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EmailFolder::getTableName方法代碼示例

本文整理匯總了PHP中EmailFolder::getTableName方法的典型用法代碼示例。如果您正苦於以下問題:PHP EmailFolder::getTableName方法的具體用法?PHP EmailFolder::getTableName怎麽用?PHP EmailFolder::getTableName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在EmailFolder的用法示例。


在下文中一共展示了EmailFolder::getTableName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: makeCampaignsSqlQuery

 /**
  * @param array $searchAttributeData
  * @param string $groupBy
  * @return string
  */
 protected static function makeCampaignsSqlQuery($searchAttributeData, $groupBy)
 {
     $quote = DatabaseCompatibilityUtil::getQuote();
     $where = null;
     $selectDistinct = false;
     $campaignTableName = Campaign::getTableName();
     $campaignItemTableName = CampaignItem::getTableName();
     $itemTableName = Item::getTableName();
     $emailMessageTableName = EmailMessage::getTableName();
     $emailFolderTableName = EmailFolder::getTableName();
     $sentDateTimeColumnName = EmailMessage::getColumnNameByAttribute('sentDateTime');
     $createdDateTimeColumnName = Item::getColumnNameByAttribute('createdDateTime');
     $folderTypeColumnName = EmailFolder::getColumnNameByAttribute('type');
     $joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('Campaign');
     $where = RedBeanModelDataProvider::makeWhere('Campaign', $searchAttributeData, $joinTablesAdapter);
     Campaign::resolveReadPermissionsOptimizationToSqlQuery(Yii::app()->user->userModel, $joinTablesAdapter, $where, $selectDistinct);
     $selectQueryAdapter = new RedBeanModelSelectQueryAdapter($selectDistinct);
     // Begin Not Coding Standard
     $queuedEmailsSelectPart = "sum(CASE WHEN (({$quote}{$emailMessageTableName}{$quote}.{$quote}{$sentDateTimeColumnName}" . $quote . " = '0000-00-00 00:00:00' OR {$quote}{$emailMessageTableName}{$quote}" . ".{$quote}{$sentDateTimeColumnName}{$quote} IS NULL) AND " . "({$quote}{$emailFolderTableName}{$quote}.{$quote}{$folderTypeColumnName}{$quote} = '" . EmailFolder::TYPE_OUTBOX . "'" . " OR {$quote}{$emailFolderTableName}{$quote}.{$quote}{$folderTypeColumnName}{$quote} = '" . EmailFolder::TYPE_OUTBOX_ERROR . "'))" . " THEN 1 ELSE 0 END)";
     $sentEmailsSelectPart = "sum(CASE WHEN (({$quote}{$emailMessageTableName}{$quote}.{$quote}{$sentDateTimeColumnName}" . $quote . " > '0000-00-00 00:00:00') AND " . "{$quote}{$emailFolderTableName}{$quote}.{$quote}{$folderTypeColumnName}{$quote} = '" . EmailFolder::TYPE_SENT . "')" . "THEN 1 ELSE 0 END)";
     $failedEmailsSelectPart = "sum(CASE WHEN (({$quote}{$emailMessageTableName}{$quote}.{$quote}{$sentDateTimeColumnName}" . $quote . " = '0000-00-00 00:00:00' OR {$quote}{$emailMessageTableName}{$quote}" . ".{$quote}{$sentDateTimeColumnName}{$quote} IS NULL) AND " . "({$quote}{$emailFolderTableName}{$quote}.{$quote}{$folderTypeColumnName}{$quote} = '" . EmailFolder::TYPE_OUTBOX_FAILURE . "'))" . " THEN 1 ELSE 0 END)";
     // End Not Coding Standard
     $uniqueOpensSelectPart = static::resolveCampaignTypeSubQuery(EmailMessageActivity::TYPE_OPEN);
     $uniqueClicksSelectPart = static::resolveCampaignTypeSubQuery(EmailMessageActivity::TYPE_CLICK);
     $bouncedSelectPart = static::resolveCampaignTypeSubQuery(EmailMessageActivity::TYPE_BOUNCE);
     $optedOutSelectPart = static::resolveCampaignTypeSubQuery(EmailMessageActivity::TYPE_UNSUBSCRIBE);
     //
     $skippedSelectPart = static::resolveCampaignTypeSubQuery(EmailMessageActivity::TYPE_SKIP);
     //
     $selectQueryAdapter->addDayDateClause($itemTableName, $createdDateTimeColumnName, static::DAY_DATE);
     $selectQueryAdapter->addFirstDayOfWeekDateClause($itemTableName, $createdDateTimeColumnName, static::FIRST_DAY_OF_WEEK_DATE);
     $selectQueryAdapter->addFirstDayOfMonthDateClause($itemTableName, $createdDateTimeColumnName, static::FIRST_DAY_OF_MONTH_DATE);
     $selectQueryAdapter->addNonSpecificCountClause();
     $selectQueryAdapter->addClauseByQueryString($queuedEmailsSelectPart, static::QUEUED);
     $selectQueryAdapter->addClauseByQueryString($sentEmailsSelectPart, static::SENT);
     $selectQueryAdapter->addClauseByQueryString($failedEmailsSelectPart, static::FAILED_TO_SEND);
     $selectQueryAdapter->addClauseByQueryString("count((" . $uniqueOpensSelectPart . "))", static::UNIQUE_OPENS);
     $selectQueryAdapter->addClauseByQueryString("count((" . $uniqueClicksSelectPart . "))", static::UNIQUE_CLICKS);
     $selectQueryAdapter->addClauseByQueryString("count((" . $bouncedSelectPart . "))", static::BOUNCED);
     $selectQueryAdapter->addClauseByQueryString("count((" . $optedOutSelectPart . "))", static::UNSUBSCRIBED);
     $selectQueryAdapter->addClauseByQueryString("count((" . $skippedSelectPart . "))", static::SKIPPED);
     $joinTablesAdapter->addLeftTableAndGetAliasName($campaignItemTableName, 'id', $campaignTableName, 'campaign_id');
     $joinTablesAdapter->addLeftTableAndGetAliasName($emailMessageTableName, 'emailmessage_id', $campaignItemTableName, 'id');
     $joinTablesAdapter->addLeftTableAndGetAliasName($emailFolderTableName, 'folder_emailfolder_id', $emailMessageTableName, 'id');
     $sql = SQLQueryUtil::makeQuery($campaignTableName, $selectQueryAdapter, $joinTablesAdapter, null, null, $where, null, $groupBy);
     return $sql;
 }
開發者ID:KulturedKitsch,項目名稱:kulturedkitsch.info,代碼行數:52,代碼來源:MarketingEmailsInThisListChartDataProvider.php


注:本文中的EmailFolder::getTableName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。