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);
    }
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);
    }
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 ) ; }
Update a policy.

Replaces limitations values with new values.

@param \eZ\Publish\SPI\Persistence\User\Policy $policy
Update a policy .