Acl/Role/Registry.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Acl  
Version
$Id$  

\Zend_Acl_Role_Registry

Package: Zend_Acl
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedarray $_roles = array()
Internal Role registry data storage
Default valuearray()Details
Type
array

Methods

methodpublicadd(\Zend_Acl_Role_Interface $role, \Zend_Acl_Role_Interface | string | array $parents = null) : \Zend_Acl_Role_Registry

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.
Parameters
NameTypeDescription
$role\Zend_Acl_Role_Interface
$parents\Zend_Acl_Role_Interface | string | array
Returns
TypeDescription
\Zend_Acl_Role_RegistryProvides a fluent interface
Throws
ExceptionDescription
\Zend_Acl_Role_Registry_Exception
methodpublicget(\Zend_Acl_Role_Interface | string $role) : \Zend_Acl_Role_Interface

Returns the identified Role

The $role parameter can either be a Role or a Role identifier.
Parameters
NameTypeDescription
$role\Zend_Acl_Role_Interface | string
Returns
TypeDescription
\Zend_Acl_Role_Interface
Throws
ExceptionDescription
\Zend_Acl_Role_Registry_Exception
methodpublicgetParents(\Zend_Acl_Role_Interface | string $role) : array

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.
Parameters
NameTypeDescription
$role\Zend_Acl_Role_Interface | string
Returns
TypeDescription
array
Details
Uses
 
methodpublicgetRoles() : void

methodpublichas(\Zend_Acl_Role_Interface | string $role) : boolean

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

The $role parameter can either be a Role or a Role identifier.
Parameters
NameTypeDescription
$role\Zend_Acl_Role_Interface | string
Returns
TypeDescription
boolean
methodpublicinherits(\Zend_Acl_Role_Interface | string $role, \Zend_Acl_Role_Interface | string $inherit, boolean $onlyParents = false) : boolean

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.
Parameters
NameTypeDescription
$role\Zend_Acl_Role_Interface | string
$inherit\Zend_Acl_Role_Interface | string
$onlyParentsboolean
Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Acl_Role_Registry_Exception
methodpublicremove(\Zend_Acl_Role_Interface | string $role) : \Zend_Acl_Role_Registry

Removes the Role from the registry

The $role parameter can either be a Role or a Role identifier.
Parameters
NameTypeDescription
$role\Zend_Acl_Role_Interface | string
Returns
TypeDescription
\Zend_Acl_Role_RegistryProvides a fluent interface
Throws
ExceptionDescription
\Zend_Acl_Role_Registry_Exception
methodpublicremoveAll() : \Zend_Acl_Role_Registry

Removes all Roles from the registry

Returns
TypeDescription
\Zend_Acl_Role_RegistryProvides a fluent interface
Documentation was generated by phpDocumentor 2.2.0 .