本文整理匯總了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;
}
示例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;
}
}
示例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;
}
}