本文整理汇总了PHP中Tinebase_Container::addGrantsSql方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_Container::addGrantsSql方法的具体用法?PHP Tinebase_Container::addGrantsSql怎么用?PHP Tinebase_Container::addGrantsSql使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinebase_Container
的用法示例。
在下文中一共展示了Tinebase_Container::addGrantsSql方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _appendGrantsFilter
/**
* append grants acl filter
*
* @param Zend_Db_Select $select
* @param Tinebase_Backend_Sql_Abstract $backend
* @param Tinebase_Model_User $user
*/
protected function _appendGrantsFilter($select, $backend, $user)
{
$db = $backend->getAdapter();
$select->join(array($this->_aclTableName => SQL_TABLE_PREFIX . $this->_aclTableName), "{$db->quoteIdentifier($this->_aclTableName . '.record_id')} = {$db->quoteIdentifier($backend->getTableName() . '.id')}", array());
Tinebase_Container::addGrantsSql($select, $user, $this->_requiredGrants, $this->_aclTableName);
if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' $select after appending grants sql: ' . $select);
}
}
示例2: getAclForIds
/**
* all grants for configs given by array of ids
*
* @param string $_accountId
* @param array $_ids => account_grants
* @return array
*/
public function getAclForIds($_accountId, $_ids)
{
$result = array();
if (empty($_ids)) {
return $result;
}
$select = $this->_getAclSelect(array('id' => 'customfield_config.id', 'account_grants' => $this->_dbCommand->getAggregate('customfield_acl.account_grant')));
$select->where($this->_db->quoteInto($this->_db->quoteIdentifier('customfield_config.id') . ' IN (?)', (array) $_ids))->group(array('customfield_config.id', 'customfield_acl.account_type', 'customfield_acl.account_id'));
Tinebase_Container::addGrantsSql($select, $_accountId, Tinebase_Model_CustomField_Grant::getAllGrants(), 'customfield_acl');
//if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' ' . $select->__toString());
$stmt = $this->_db->query($select);
$rows = $stmt->fetchAll(Zend_Db::FETCH_ASSOC);
foreach ($rows as $row) {
$result[$row['id']] = $row['account_grants'];
}
return $result;
}