PHP Class Pop\Auth\Role

Author: Nick Sagona, III ([email protected])
Afficher le fichier Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Свойство Type Description
$children array Role children
$name string Role name
$parent Role Role parent
$permissions array Role permissions

Méthodes publiques

Méthode Description
__construct ( string $name ) : Role Constructor
__toString ( ) : string Method to return the string value of the name of the role
addChild ( mixed $role ) : Role Method to add a child role
addPermission ( string $name ) : Role Method to add a permission to the role
factory ( string $name ) : Role Static method to instantiate the role object and return itself to facilitate chaining methods together.
getName ( ) : string Method to get the role name
getParent ( ) : Role Method to get the role parent
hasParent ( ) : Role Method to see if the role has a parent
hasPermission ( string $name ) : boolean Method to check if a role has a permission
setParent ( Role $parent ) : Role Method to set the role parent

Method Details

__construct() public méthode

Instantiate the role object
public __construct ( string $name ) : Role
$name string
Résultat Role

__toString() public méthode

Method to return the string value of the name of the role
public __toString ( ) : string
Résultat string

addChild() public méthode

Method to add a child role
public addChild ( mixed $role ) : Role
$role mixed
Résultat Role

addPermission() public méthode

Method to add a permission to the role
public addPermission ( string $name ) : Role
$name string
Résultat Role

factory() public static méthode

Static method to instantiate the role object and return itself to facilitate chaining methods together.
public static factory ( string $name ) : Role
$name string
Résultat Role

getName() public méthode

Method to get the role name
public getName ( ) : string
Résultat string

getParent() public méthode

Method to get the role parent
public getParent ( ) : Role
Résultat Role

hasParent() public méthode

Method to see if the role has a parent
public hasParent ( ) : Role
Résultat Role

hasPermission() public méthode

Method to check if a role has a permission
public hasPermission ( string $name ) : boolean
$name string
Résultat boolean

setParent() public méthode

Method to set the role parent
public setParent ( Role $parent ) : Role
$parent Role
Résultat Role

Property Details

$children protected_oe property

Role children
protected array $children
Résultat array

$name protected_oe property

Role name
protected string $name
Résultat string

$parent protected_oe property

Role parent
protected Role,Pop\Auth $parent
Résultat Role

$permissions protected_oe property

Role permissions
protected array $permissions
Résultat array