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


PHP TableGateway::executeSelect方法代碼示例

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


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

示例1: executeSelect

 protected function executeSelect(Select $select)
 {
     $selectState = $select->getRawState();
     $result = parent::executeSelect($select);
     $result = $this->applyHook('table.select', [$result, $selectState]);
     return $result;
 }
開發者ID:jel-massih,項目名稱:directus,代碼行數:7,代碼來源:BaseTableGateway.php

示例2: executeSelect

 /**
  * @param Select $select
  * @return ResultSet
  * @throws \RuntimeException
  */
 protected function executeSelect(Select $select)
 {
     /**
      * ACL Enforcement
      */
     $selectState = $select->getRawState();
     $table = $this->getRawTableNameFromQueryStateTable($selectState['table']);
     // Enforce field read blacklist on Select's main table
     $this->acl->enforceBlacklist($table, $selectState['columns'], Acl::FIELD_READ_BLACKLIST);
     // Enforce field read blacklist on Select's join tables
     foreach ($selectState['joins'] as $join) {
         $joinTable = $this->getRawTableNameFromQueryStateTable($join['name']);
         $this->acl->enforceBlacklist($joinTable, $join['columns'], Acl::FIELD_READ_BLACKLIST);
     }
     try {
         return parent::executeSelect($select);
     } catch (\Zend\Db\Adapter\Exception\InvalidQueryException $e) {
         if ('production' !== DIRECTUS_ENV) {
             throw new \RuntimeException("This query failed: " . $this->dumpSql($select), 0, $e);
         }
         // @todo send developer warning
         throw $e;
     }
 }
開發者ID:rudderdon,項目名稱:Directus,代碼行數:29,代碼來源:AclAwareTableGateway.php

示例3: executeSelect

 /**
  * @param Select $select
  * @return ResultSet
  * @throws \RuntimeException
  */
 protected function executeSelect(Select $select)
 {
     /**
      * ACL Enforcement
      */
     $selectState = $select->getRawState();
     $table = $this->getRawTableNameFromQueryStateTable($selectState['table']);
     // Enforce field read blacklist on Select's main table
     try {
         // @TODO: Enforce must return a list of columns without the blacklist
         // when asterisk (*) is used
         // and only throw and error when all the selected columns are blacklisted
         $this->acl->enforceBlacklist($table, $selectState['columns'], Acl::FIELD_READ_BLACKLIST);
     } catch (\Exception $e) {
         if ($selectState['columns'][0] != '*') {
             throw $e;
         }
         $selectState['columns'] = TableSchema::getAllNonAliasTableColumns($table);
         $this->acl->enforceBlacklist($table, $selectState['columns'], Acl::FIELD_READ_BLACKLIST);
     }
     // Enforce field read blacklist on Select's join tables
     foreach ($selectState['joins'] as $join) {
         $joinTable = $this->getRawTableNameFromQueryStateTable($join['name']);
         $this->acl->enforceBlacklist($joinTable, $join['columns'], Acl::FIELD_READ_BLACKLIST);
     }
     try {
         return $this->processSelect($selectState, parent::executeSelect($select));
     } catch (\Zend\Db\Adapter\Exception\InvalidQueryException $e) {
         if ('production' !== DIRECTUS_ENV) {
             throw new \RuntimeException('This query failed: ' . $this->dumpSql($select), 0, $e);
         }
         // @todo send developer warning
         throw $e;
     }
 }
開發者ID:YounessTayer,項目名稱:directus,代碼行數:40,代碼來源:AclAwareTableGateway.php


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