Zend\Permissions\Acl\Role\Registry::add
Adds a Role having an identifier unique to the registry
The $parents parameter may be a reference to, or the string identifier for, a Role existing in the registry, or $parents may be passed as an array of these - mixing string identifiers and objects is ok - to indicate the Roles from which the newly added Role will directly inherit. In order to resolve potential ambiguities with conflicting rules inherited from different parents, the most recently added parent takes precedence over parents that were previously added. In other words, the first parent added will have the least priority, and the last parent added will have the highest priority.
Signature
public function add(RoleInterface
$role,
[RoleInterface|string|array|Traversable
$parents = null] )
Parameters
$role
— Zend\Permissions\Acl\Role\RoleInterface
$parents
— object
Returns
- Registry
- Provides a fluent interface