addPolicyLimitations() абстрактный публичный Метод

Adds limitations to an existing policy.
abstract public addPolicyLimitations ( integer $policyId, array $limitations )
$policyId integer
$limitations array
Пример #1
0
 /**
  * Update a policy.
  *
  * Replaces limitations values with new values.
  *
  * @param \eZ\Publish\SPI\Persistence\User\Policy $policy
  */
 public function updatePolicy(Policy $policy)
 {
     $policy = clone $policy;
     $this->limitationConverter->toLegacy($policy);
     $this->roleGateway->removePolicyLimitations($policy->id);
     $this->roleGateway->addPolicyLimitations($policy->id, $policy->limitations === '*' ? array() : $policy->limitations);
 }
 /**
  * Adds limitations to an existing policy.
  *
  * @param int $policyId
  * @param array $limitations
  */
 public function addPolicyLimitations($policyId, array $limitations)
 {
     try {
         return $this->innerGateway->addPolicyLimitations($policyId, $limitations);
     } catch (DBALException $e) {
         throw new RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new RuntimeException('Database error', 0, $e);
     }
 }