本文整理匯總了PHP中Symfony\Component\Security\Acl\Model\AclInterface::getParentAcl方法的典型用法代碼示例。如果您正苦於以下問題:PHP AclInterface::getParentAcl方法的具體用法?PHP AclInterface::getParentAcl怎麽用?PHP AclInterface::getParentAcl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\Security\Acl\Model\AclInterface
的用法示例。
在下文中一共展示了AclInterface::getParentAcl方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: regenerateAncestorRelations
/**
* This regenerates the ancestor table which is used for fast read access.
*
* @param AclInterface $acl
*/
private function regenerateAncestorRelations(AclInterface $acl)
{
$pk = $acl->getId();
$this->connection->executeQuery($this->getDeleteObjectIdentityRelationsSql($pk));
$this->connection->executeQuery($this->getInsertObjectIdentityRelationSql($pk, $pk));
$parentAcl = $acl->getParentAcl();
while (null !== $parentAcl) {
$this->connection->executeQuery($this->getInsertObjectIdentityRelationSql($pk, $parentAcl->getId()));
$parentAcl = $parentAcl->getParentAcl();
}
}
示例2: putInCache
/**
* {@inheritdoc}
*/
public function putInCache(AclInterface $acl)
{
if (null === $acl->getId()) {
throw new \InvalidArgumentException('Transient ACLs cannot be cached.');
}
$parentAcl = $acl->getParentAcl();
if (null !== $parentAcl) {
$this->putInCache($parentAcl);
}
$key = $this->createKeyFromIdentity($acl->getObjectIdentity());
$this->cache->save($key, serialize($acl));
$this->cache->save($acl->getId(), $key);
}
示例3: updateObjectIdentity
/**
* This updates the parent and ancestors in the identity
*
* @param AclInterface $acl
* @param array $changes
* @return void
*/
protected function updateObjectIdentity(AclInterface $acl, array $changes)
{
if (isset($changes['entriesInheriting'])) {
$updates['entriesInheriting'] = $changes['entriesInheriting'][1];
}
if (isset($changes['parentAcl'])) {
$query = array('_id' => new \MongoId($acl->getParentAcl()->getId()));
$parent = $this->connection->selectCollection($this->options['oid_collection'])->findOne($query);
$updates['parent'] = $parent;
if (isset($parent['ancestors'])) {
$ancestors = $parent['ancestors'];
}
$ancestors[] = $parent['_id'];
$updates['ancestors'] = $ancestors;
}
if (!isset($updates)) {
return;
}
$entry = array('_id' => new \MongoId($acl->getId()));
$newData = array('$set' => $updates);
$this->connection->selectCollection($this->options['oid_collection'])->update($entry, $newData);
}