package Default
inherited_from \Zend\Permissions\Rbac\AbstractIterator

 Methods

Add a child.

addRole(string|\Zend\Permissions\Rbac\RoleInterface $child, array|\Zend\Permissions\Rbac\RoleInterface|null $parents = null) : \Zend\Permissions\Rbac\Rbac
fluent This method is part of a fluent interface and will return the same instance

Parameters

$child

string\Zend\Permissions\Rbac\RoleInterface

$parents

array\Zend\Permissions\Rbac\RoleInterfacenull

Exceptions

\Zend\Permissions\Rbac\Exception\InvalidArgumentException

Returns

\Zend\Permissions\Rbac\Rbac

(PHP 5 &gt;= 5.0.0)<br/> Return the current element

current() : mixed
Inherited
link http://php.net/manual/en/iterator.current.php

Returns

mixedCan return any type.

(PHP 5 &gt;= 5.1.0)<br/> Returns an iterator for the current entry.

getChildren() : \RecursiveIterator
Inherited
link http://php.net/manual/en/recursiveiterator.getchildren.php

Returns

\RecursiveIteratorAn iterator for the current entry.

getCreateMissingRoles()

getCreateMissingRoles() : boolean

Returns

boolean

Get a child.

getRole(\Zend\Permissions\Rbac\RoleInterface|string $objectOrName) : \Zend\Permissions\Rbac\RoleInterface

Parameters

$objectOrName

\Zend\Permissions\Rbac\RoleInterfacestring

Exceptions

\Zend\Permissions\Rbac\Exception\InvalidArgumentException

Returns

\Zend\Permissions\Rbac\RoleInterface

(PHP 5 &gt;= 5.1.0)<br/> Returns if an iterator can be created fot the current entry.

hasChildren() : boolean
Inherited
link http://php.net/manual/en/recursiveiterator.haschildren.php

Returns

booleantrue if the current entry can be iterated over, otherwise returns false.

Is a child with $name registered?

hasRole(\Zend\Permissions\Rbac\RoleInterface|string $objectOrName) : boolean

Parameters

$objectOrName

\Zend\Permissions\Rbac\RoleInterfacestring

Returns

boolean

Determines if access is granted by checking the role and child roles for permission.

isGranted(\Zend\Permissions\Rbac\RoleInterface|string $role, string $permission, \Zend\Permissions\Rbac\AssertionInterface|Callable|null $assert = null) : boolean

Parameters

$role

\Zend\Permissions\Rbac\RoleInterfacestring

$permission

string

$assert

\Zend\Permissions\Rbac\AssertionInterfaceCallablenull

Exceptions

\Zend\Permissions\Rbac\Exception\InvalidArgumentException

Returns

boolean

(PHP 5 &gt;= 5.0.0)<br/> Return the key of the current element

key() : integer | null
Inherited
link http://php.net/manual/en/iterator.key.php

Returns

integernullscalar on success, or null on failure.

(PHP 5 &gt;= 5.0.0)<br/> Move forward to next element

next() : void
Inherited

(PHP 5 &gt;= 5.0.0)<br/> Rewind the Iterator to the first element

rewind() : void
Inherited

setCreateMissingRoles()

setCreateMissingRoles(boolean $createMissingRoles) : \Zend\Permissions\Rbac\Rbac

Parameters

$createMissingRoles

boolean

Returns

\Zend\Permissions\Rbac\Rbac

(PHP 5 &gt;= 5.0.0)<br/> Checks if current position is valid

valid() : boolean
Inherited
link http://php.net/manual/en/iterator.valid.php

Returns

booleanThe return value will be casted to boolean and then evaluated. Returns true on success or false on failure.

 Properties

 

$children

$children : array

Default

array()
 

flag: whether or not to create roles automatically if they do not exist.

$createMissingRoles : boolean

Default

false
 

$index

$index : integer

Default

0