本文整理汇总了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;
}
}