eZ\Publish\Core\Persistence\Legacy\User\Role\Gateway\ExceptionConversion::addPolicy PHP Method

addPolicy() public method

Adds a policy to a role.
public addPolicy ( mixed $roleId, eZ\Publish\SPI\Persistence\User\Policy $policy )
$roleId mixed
$policy eZ\Publish\SPI\Persistence\User\Policy
    public function addPolicy($roleId, Policy $policy)
    {
        try {
            return $this->innerGateway->addPolicy($roleId, $policy);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }