本文整理汇总了PHP中Symfony\Component\Security\Acl\Model\AclInterface::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP AclInterface::getId方法的具体用法?PHP AclInterface::getId怎么用?PHP AclInterface::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Security\Acl\Model\AclInterface
的用法示例。
在下文中一共展示了AclInterface::getId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: putInCache
public function putInCache(AclInterface $acl)
{
if (null === $acl->getId()) {
throw new \InvalidArgumentException('The given ACL does not have an ID.');
}
$this->content[$acl->getId()] = $acl;
}
示例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: setParentAcl
/**
* {@inheritdoc}
*/
public function setParentAcl(AclInterface $acl = null)
{
if (null !== $acl && null === $acl->getId()) {
throw new \InvalidArgumentException('$acl must have an ID.');
}
if ($this->parentAcl !== $acl) {
$this->onPropertyChanged('parentAcl', $this->parentAcl, $acl);
$this->parentAcl = $acl;
}
}
示例4: 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();
}
}
示例5: 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);
}