[Security][Acl] Issue #5787 : Added MutableAclProvider::deleteSecurityIdentity

Code style fix and documentation typo
This commit is contained in:
Sébastien Lavoie 2013-06-18 17:56:09 -04:00
parent d744ffaaeb
commit bdbbe58128

View File

@ -108,6 +108,18 @@ class MutableAclProvider extends AclProvider implements MutableAclProviderInterf
}
}
/**
* Deletes the security identity from the database.
* ACL entries have the CASCADE option on their foreign key so they will also get deleted
*
* @param SecurityIdentityInterface $sid
* @throws \InvalidArgumentException
*/
public function deleteSecurityIdentity(SecurityIdentityInterface $sid)
{
$this->connection->executeQuery($this->getDeleteSecurityIdentityIdSql($sid));
}
/**
* {@inheritDoc}
*/
@ -595,6 +607,21 @@ QUERY;
);
}
/**
* Constructs the SQL to delete a security identity.
*
* @param SecurityIdentityInterface $sid
* @throws \InvalidArgumentException
* @return string
*/
protected function getDeleteSecurityIdentityIdSql(SecurityIdentityInterface $sid)
{
$select = $this->getSelectSecurityIdentityIdSql($sid);
$delete = preg_replace('/^SELECT id FROM/', 'DELETE FROM', $select);
return $delete;
}
/**
* Constructs the SQL for updating an object identity.
*