API Documentation

Zend/Acl/Role/Registry.php

Show: inherited
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Acl  
Version
$Id: Registry.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Acl_Role_Registry

Package: Zend\Acl

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

Properties

Propertyprotectedarray  $_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
Name Type Description
$role \Zend_Acl_Role_Interface
$parents \Zend_Acl_Role_Interface|string|array
Returns
Type Description
\Zend_Acl_Role_Registry Provides a fluent interface
Throws
Exception Description
\Zend_Acl_Role_Registry_Exception
Details
Used_by
\Zend_Acl::addRole()  
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
Name Type Description
$role \Zend_Acl_Role_Interface|string
Returns
Type Description
\Zend_Acl_Role_Interface
Throws
Exception Description
\Zend_Acl_Role_Registry_Exception
Details
Used_by
\Zend_Acl::getRole()  
Used_by
\Zend_Acl::setRule()  
Used_by
\Zend_Acl::isAllowed()  
Used_by
\Zend_Acl_Role_Registry::getParents()  
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
Name Type Description
$role \Zend_Acl_Role_Interface|string
Returns
Type Description
array
Details
Uses
\Zend_Acl_Role_Registry::get()  
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
Name Type Description
$role \Zend_Acl_Role_Interface|string
Returns
Type Description
boolean
Details
Used_by
\Zend_Acl::hasRole()  
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
Name Type Description
$role \Zend_Acl_Role_Interface|string
$inherit \Zend_Acl_Role_Interface|string
$onlyParents boolean
Returns
Type Description
boolean
Throws
Exception Description
\Zend_Acl_Role_Registry_Exception
Details
Used_by
\Zend_Acl::inheritsRole()  
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
Name Type Description
$role \Zend_Acl_Role_Interface|string
Returns
Type Description
\Zend_Acl_Role_Registry Provides a fluent interface
Throws
Exception Description
\Zend_Acl_Role_Registry_Exception
Details
Used_by
\Zend_Acl::removeRole()  
methodpublicremoveAll( ) : \Zend_Acl_Role_Registry

Removes all Roles from the registry

Returns
Type Description
\Zend_Acl_Role_Registry Provides a fluent interface
Details
Used_by
\Zend_Acl::removeRoleAll()  
Documentation was generated by DocBlox 0.15.1.