category Zend
package Zend_Acl
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Adds a Role having an identifier unique to the registry

add(\Zend_Acl_Role_Interface $role, \Zend_Acl_Role_Interface|string|array $parents = null) : \Zend_Acl_Role_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.

Parameters

$role

\Zend_Acl_Role_Interface

$parents

\Zend_Acl_Role_Interfacestringarray

Exceptions

\Zend_Acl_Role_Registry_Exception

Returns

\Zend_Acl_Role_RegistryProvides a fluent interface

Returns the identified Role

get(\Zend_Acl_Role_Interface|string $role) : \Zend_Acl_Role_Interface

The $role parameter can either be a Role or a Role identifier.

Parameters

$role

\Zend_Acl_Role_Interfacestring

Exceptions

\Zend_Acl_Role_Registry_Exception

Returns

\Zend_Acl_Role_Interface

Returns an array of an existing Role's parents

getParents(\Zend_Acl_Role_Interface|string $role) : array

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.

uses

Parameters

$role

\Zend_Acl_Role_Interfacestring

Returns

array

getRoles()

getRoles() 

Returns true if and only if the Role exists in the registry

has(\Zend_Acl_Role_Interface|string $role) : boolean

The $role parameter can either be a Role or a Role identifier.

Parameters

$role

\Zend_Acl_Role_Interfacestring

Returns

boolean

Returns true if and only if $role inherits from $inherit

inherits(\Zend_Acl_Role_Interface|string $role, \Zend_Acl_Role_Interface|string $inherit, boolean $onlyParents = false) : boolean

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.

Parameters

$role

\Zend_Acl_Role_Interfacestring

$inherit

\Zend_Acl_Role_Interfacestring

$onlyParents

boolean

Exceptions

\Zend_Acl_Role_Registry_Exception

Returns

boolean

Removes the Role from the registry

remove(\Zend_Acl_Role_Interface|string $role) : \Zend_Acl_Role_Registry

The $role parameter can either be a Role or a Role identifier.

Parameters

$role

\Zend_Acl_Role_Interfacestring

Exceptions

\Zend_Acl_Role_Registry_Exception

Returns

\Zend_Acl_Role_RegistryProvides a fluent interface

Removes all Roles from the registry

removeAll() : \Zend_Acl_Role_Registry

Returns

\Zend_Acl_Role_RegistryProvides a fluent interface

 Properties

 

Internal Role registry data storage

$_roles : array

Default

array()