public function addPolicyByRoleDraft($roleId, Policy $policy)
    {
        $legacyPolicy = clone $policy;
        $legacyPolicy->originalId = $policy->id;
        $this->limitationConverter->toLegacy($legacyPolicy);

        $this->roleGateway->addPolicy($roleId, $legacyPolicy);
        $policy->id = $legacyPolicy->id;
        $policy->originalId = $legacyPolicy->originalId;
        $policy->roleId = $legacyPolicy->roleId;

        return $policy;
    }
public function addPolicyByRoleDraft($roleId, Policy $policy)
    {
        $legacyPolicy = clone $policy;
        $legacyPolicy->originalId = $policy->id;
        $this->limitationConverter->toLegacy($legacyPolicy);

        $this->roleGateway->addPolicy($roleId, $legacyPolicy);
        $policy->id = $legacyPolicy->id;
        $policy->originalId = $legacyPolicy->originalId;
        $policy->roleId = $legacyPolicy->roleId;

        return $policy;
    }
public function addPolicyByRoleDraft ( $ roleId , Policy $ policy ) { $ legacyPolicy = clone $ policy ; $ legacyPolicy -> originalId = $ policy -> id ; $ this -> limitationConverter -> toLegacy ( $ legacyPolicy ) ; $ this -> roleGateway -> addPolicy ( $ roleId , $ legacyPolicy ) ; $ policy -> id = $ legacyPolicy -> id ; $ policy -> originalId = $ legacyPolicy -> originalId ; $ policy -> roleId = $ legacyPolicy -> roleId ; return $ policy ; }
Adds a policy to a role draft.

@param mixed $roleId
@param \eZ\Publish\SPI\Persistence\User\Policy $policy

@return \eZ\Publish\SPI\Persistence\User\Policy
Adds a policy to a role draft .