Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
add (Zend_Acl_Role_Interface $role, $parents=null) | |
get ($role) | |
has ($role) | |
getParents ($role) | |
inherits ($role, $inherit, $onlyParents=false) | |
remove ($role) | |
removeAll () | |
getRoles () | |
Protected Attributes | |
$_roles = array() | |
Definition at line 35 of file Registry.php.
add | ( | Zend_Acl_Role_Interface | $role, |
$parents = null |
|||
) |
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.
Zend_Acl_Role_Interface | $role | |
Zend_Acl_Role_Interface | string | array | $parents |
Zend_Acl_Role_Registry_Exception |
Definition at line 63 of file Registry.php.
get | ( | $role | ) |
Returns the identified Role
The $role parameter can either be a Role or a Role identifier.
Zend_Acl_Role_Interface | string | $role |
Zend_Acl_Role_Registry_Exception |
Definition at line 119 of file Registry.php.
getParents | ( | $role | ) |
Returns an array of an existing Role's parents
The array keys are the identifiers of the parent Roles, and the values are the parent Role instances. The parent Roles are ordered in this array by ascending priority. The highest priority parent Role, last in the array, corresponds with the parent Role most recently added.
If the Role does not have any parents, then an empty array is returned.
Zend_Acl_Role_Interface | string | $role | @uses Zend_Acl_Role_Registry::get() |
Definition at line 171 of file Registry.php.
getRoles | ( | ) |
Definition at line 266 of file Registry.php.
has | ( | $role | ) |
Returns true if and only if the Role exists in the registry
The $role parameter can either be a Role or a Role identifier.
Zend_Acl_Role_Interface | string | $role |
Definition at line 146 of file Registry.php.
inherits | ( | $role, | |
$inherit, | |||
$onlyParents = false |
|||
) |
Returns true if and only if $role inherits from $inherit
Both parameters may be either a Role or a Role identifier. If $onlyParents is true, then $role must inherit directly from $inherit in order to return true. By default, this method looks through the entire inheritance DAG to determine whether $role inherits from $inherit through its ancestor Roles.
Zend_Acl_Role_Interface | string | $role | |
Zend_Acl_Role_Interface | string | $inherit | |
boolean | $onlyParents |
Zend_Acl_Role_Registry_Exception |
Definition at line 193 of file Registry.php.
remove | ( | $role | ) |
Removes the Role from the registry
The $role parameter can either be a Role or a Role identifier.
Zend_Acl_Role_Interface | string | $role |
Zend_Acl_Role_Registry_Exception |
Definition at line 230 of file Registry.php.
removeAll | ( | ) |
Removes all Roles from the registry
Definition at line 259 of file Registry.php.
|
protected |
Definition at line 42 of file Registry.php.