Class Role

Summary

Fully Qualified Name: Zend\Permissions\Rbac\Role
Extends: AbstractRole

Description

Methods

Name Description Defined By
__construct() Role
addChild() Add a child. AbstractRole
addParent() AbstractRole
addPermission() Add permission to the role. AbstractRole
current() (PHP 5 >= 5.0.0)
Return the current element
AbstractIterator
getChildren() (PHP 5 >= 5.1.0)
Returns an iterator for the current entry.
AbstractIterator
getName() Get the name of the role. AbstractRole
getParent() AbstractRole
hasChildren() (PHP 5 >= 5.1.0)
Returns if an iterator can be created fot the current entry.
AbstractIterator
hasPermission() Checks if a permission exists for this role or any child roles. AbstractRole
key() (PHP 5 >= 5.0.0)
Return the key of the current element
AbstractIterator
next() (PHP 5 >= 5.0.0)
Move forward to next element
AbstractIterator
rewind() (PHP 5 >= 5.0.0)
Rewind the Iterator to the first element
AbstractIterator
setParent() AbstractRole
valid() (PHP 5 >= 5.0.0)
Checks if current position is valid
AbstractIterator

Method Details

__construct()

Parameter Name Type Description
$name string

Returns:

addChild()

Add a child.

Parameter Name Type Description
$child \RoleInterface|string

Returns: \Role

addParent()

Parameter Name Type Description
$parent \RoleInterface

Returns: \RoleInterface

addPermission()

Add permission to the role.

Parameter Name Type Description
$name
$name

Returns: \RoleInterface

current()

(PHP 5 >= 5.0.0)
Return the current element

Returns: mixed Can return any type.

getChildren()

(PHP 5 >= 5.1.0)
Returns an iterator for the current entry.

Returns: \RecursiveIterator An iterator for the current entry.

getName()

Get the name of the role.

Returns: string

getParent()

Returns: null|\RoleInterface|array

hasChildren()

(PHP 5 >= 5.1.0)
Returns if an iterator can be created fot the current entry.

Returns: bool true if the current entry can be iterated over, otherwise returns false.

hasPermission()

Checks if a permission exists for this role or any child roles.

Parameter Name Type Description
$name string

Returns: bool

key()

(PHP 5 >= 5.0.0)
Return the key of the current element

Returns: int|null scalar on success, or null on failure.

next()

(PHP 5 >= 5.0.0)
Move forward to next element

Returns: void Any returned value is ignored.

rewind()

(PHP 5 >= 5.0.0)
Rewind the Iterator to the first element

Returns: void Any returned value is ignored.

setParent()

Parameter Name Type Description
$parent \RoleInterface

Returns: \RoleInterface

valid()

(PHP 5 >= 5.0.0)
Checks if current position is valid

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

Top