当前位置: 首页>>代码示例>>PHP>>正文


PHP AclInterface::getId方法代码示例

本文整理汇总了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;
 }
开发者ID:ChazalFlorian,项目名称:enjoyPangolin,代码行数:7,代码来源:ArrayCache.php

示例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);
 }
开发者ID:Dren-x,项目名称:mobit,代码行数:16,代码来源:AclCache.php

示例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;
     }
 }
开发者ID:tsurune,项目名称:Pruebas,代码行数:13,代码来源:Acl.php

示例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();
     }
 }
开发者ID:rcastardo,项目名称:symfony,代码行数:16,代码来源:MutableAclProvider.php

示例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);
 }
开发者ID:Cobrowser,项目名称:MongoDBAclBundle,代码行数:29,代码来源:MutableAclProvider.php


注:本文中的Symfony\Component\Security\Acl\Model\AclInterface::getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。