本文整理汇总了PHP中GO\Base\Db\FindParams::ignoreAcl方法的典型用法代码示例。如果您正苦于以下问题:PHP FindParams::ignoreAcl方法的具体用法?PHP FindParams::ignoreAcl怎么用?PHP FindParams::ignoreAcl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GO\Base\Db\FindParams
的用法示例。
在下文中一共展示了FindParams::ignoreAcl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforeStoreStatement
protected function beforeStoreStatement(array &$response, array &$params, \GO\Base\Data\AbstractStore &$store, \GO\Base\Db\FindParams $storeParams)
{
//SELECT * FROM cal_categories t
//LEFT JOIN go_acl ON (`t`.`acl_id` = go_acl.acl_id AND (go_acl.user_id=57 OR go_acl.group_id IN (2)))
//WHERE t.calendar_id = 0 AND go_acl.acl_id IS NOT NULL OR t.calendar_id=56
$groupIds = \GO\Base\Model\User::getGroupIds(\GO::user()->id);
$storeCriteria = $storeParams->getCriteria();
$joinUserGroupCriteria = \GO\Base\Db\FindCriteria::newInstance()->addCondition('user_id', \GO::user()->id, '=', 'go_acl', false)->addInCondition('group_id', $groupIds, 'go_acl', false);
$joinCriteria = \GO\Base\Db\FindCriteria::newInstance()->addCondition('acl_id', 'go_acl.acl_id', '=', 't', true, true)->mergeWith($joinUserGroupCriteria);
$storeParams->join('go_acl', $joinCriteria, 'go_acl', 'LEFT');
if (!empty($params['global_categories']) && !empty($params['calendar_id'])) {
$storeCriteria->addCondition('calendar_id', 0, '=', 't', false);
$storeCriteria->addCondition('acl_id', NULL, 'IS NOT', 'go_acl');
$storeCriteria->addCondition('calendar_id', $params['calendar_id'], '=', 't', false);
} elseif (!empty($params['calendar_id'])) {
$storeCriteria->addCondition('calendar_id', $params['calendar_id']);
} else {
$storeCriteria->addCondition('calendar_id', 0);
}
$storeParams->ignoreAcl();
return parent::beforeStoreStatement($response, $params, $store, $storeParams);
}
示例2: addSelectedToFindCriteria
/**
* Add the selected id's to the findCriteria. You use this in the other controller. eg. ContactController and not AddressbookController.
* Should be called in \GO\Base\Controller\AbstractModelController::beforeStoreStatement
* Will be called in \GO\Base\Data\DbStore::multiSelect()
* @param \GO\Base\Db\FindParams $findParams (object reference)
* @param string $columnName database column to match keys to
* @param string $tableAlias table alias of the column to match
* @param boolean $useAnd use AND when adding where condition
* @param boolean $useNot use NOT when adding where condition
*/
public function addSelectedToFindCriteria(\GO\Base\Db\FindParams &$findParams, $columnName, $tableAlias = 't', $useAnd = true, $useNot = false)
{
$selectedCount = count($this->selectedIds);
//ignore here. Permissions are checked in by _setSelectedIds.
if ($this->_checkPermissions) {
// $this->_validateSelection();
if ($selectedCount) {
$findParams->ignoreAcl();
}
}
if ($selectedCount) {
if ($selectedCount > 1) {
$tableName = "ms_" . $this->_requestParamName;
$findParams->getCriteria()->addInTemporaryTableCondition($tableName, $columnName, $this->selectedIds, $tableAlias, $useAnd, $useNot);
} else {
// $findParams->getCriteria()->addInCondition($columnName, $this->selectedIds, $tableAlias, $useAnd, $useNot);
$findParams->getCriteria()->addCondition($columnName, $this->selectedIds[0], $useNot ? '!=' : '=', $tableAlias, $useAnd);
}
}
// $findParams->debugSql();
// $this->_save();
}