public function addPolicyByRoleDraft(RoleDraft $roleDraft, PolicyCreateStruct $policyCreateStruct)
    {
        $returnValue = $this->service->addPolicyByRoleDraft($roleDraft, $policyCreateStruct);
        $this->signalDispatcher->emit(
            new AddPolicyByRoleDraftSignal(
                array(
                    'roleId' => $roleDraft->id,
                    'policyId' => $returnValue->id,
                )
            )
        );

        return $returnValue;
    }
public function addPolicyByRoleDraft(RoleDraft $roleDraft, PolicyCreateStruct $policyCreateStruct)
    {
        $returnValue = $this->service->addPolicyByRoleDraft($roleDraft, $policyCreateStruct);
        $this->signalDispatcher->emit(
            new AddPolicyByRoleDraftSignal(
                array(
                    'roleId' => $roleDraft->id,
                    'policyId' => $returnValue->id,
                )
            )
        );

        return $returnValue;
    }
public function addPolicyByRoleDraft ( RoleDraft $ roleDraft , PolicyCreateStruct $ policyCreateStruct ) { $ returnValue = $ this -> service -> addPolicyByRoleDraft ( $ roleDraft , $ policyCreateStruct ) ; $ this -> signalDispatcher -> emit ( new AddPolicyByRoleDraftSignal ( array ( 'roleId' => $ roleDraft -> id , 'policyId' => $ returnValue -> id , ) ) ) ; return $ returnValue ; }
Adds a new policy to the role draft.

@since 6.0

@throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to add  a policy
@throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if limitation of the same type is repeated in policy create
struct or if limitation is not allowed on module/function
@throws \eZ\Publish\API\Repository\Exceptions\LimitationValidationException if a limitation in the $policyCreateStruct is not valid

@param \eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft
@param \eZ\Publish\API\Repository\Values\User\PolicyCreateStruct $policyCreateStruct

@return \eZ\Publish\API\Repository\Values\User\RoleDraft
Adds a new policy to the role draft .