Bristol SU Support Package
|
Public Member Functions | |
__construct (string $ability='', string $name='', string $description='', string $type='global', ?string $alias=null, ?string $moduleType=null) | |
getAbility () | |
setAbility (string $ability) | |
getName () | |
setName (string $name) | |
getDescription () | |
setDescription (string $description) | |
getType () | |
setType (string $type) | |
getModuleAlias () | |
setModuleAlias (?string $moduleAlias) | |
getModuleType () | |
setModuleType (?string $moduleType) | |
toArray () | |
toJson ($options=0) | |
__toString () | |
![]() | |
__construct (string $ability='', string $name='', string $description='') | |
Private Attributes | |
$ability | |
$name | |
$description | |
$type | |
$moduleAlias | |
$moduleType | |
Represents a permission
Definition at line 12 of file Permission.php.
BristolSU\Support\Permissions\Models\Permission::__construct | ( | string | $ability = '' , |
string | $name = '' , |
||
string | $description = '' , |
||
string | $type = 'global' , |
||
?string | $alias = null , |
||
?string | $moduleType = null |
||
) |
Populate the permission model with the given attributes
string | $ability | The ability string of the permission. |
string | $name | The name of the permission |
string | $description | The description for the permission |
string | $type | The type of the permission. |
string | null | $alias | The module alias for the permission, if a module permission. Null otherwise |
string | null | $moduleType | The type of module permission if a module permission. Null otherwise |
Definition at line 71 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\$ability, BristolSU\Support\Permissions\Models\Permission\$description, BristolSU\Support\Permissions\Models\Permission\$moduleType, BristolSU\Support\Permissions\Models\Permission\$name, BristolSU\Support\Permissions\Models\Permission\$type, BristolSU\Support\Permissions\Models\Permission\setAbility(), BristolSU\Support\Permissions\Models\Permission\setDescription(), BristolSU\Support\Permissions\Models\Permission\setModuleAlias(), BristolSU\Support\Permissions\Models\Permission\setModuleType(), BristolSU\Support\Permissions\Models\Permission\setName(), and BristolSU\Support\Permissions\Models\Permission\setType().
BristolSU\Support\Permissions\Models\Permission::__toString | ( | ) |
Get the permission in a JSON representation
Definition at line 240 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\toJson().
BristolSU\Support\Permissions\Models\Permission::getAbility | ( | ) |
Get the ability string of the permission
Implements BristolSU\Support\Permissions\Contracts\Models\Permission.
Definition at line 86 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\$ability.
Referenced by BristolSU\Support\Permissions\Models\Permission\toArray().
BristolSU\Support\Permissions\Models\Permission::getDescription | ( | ) |
Get the description of the permission
Implements BristolSU\Support\Permissions\Contracts\Models\Permission.
Definition at line 128 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\$description.
Referenced by BristolSU\Support\Permissions\Models\Permission\toArray().
BristolSU\Support\Permissions\Models\Permission::getModuleAlias | ( | ) |
Get the module alias of the module the permission belongs to
Implements BristolSU\Support\Permissions\Contracts\Models\Permission.
Definition at line 170 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\$moduleAlias.
Referenced by BristolSU\Support\Permissions\Models\Permission\toArray().
BristolSU\Support\Permissions\Models\Permission::getModuleType | ( | ) |
Get the type of module permission, either administrator or participant
Implements BristolSU\Support\Permissions\Contracts\Models\Permission.
Definition at line 191 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\$moduleType.
Referenced by BristolSU\Support\Permissions\Models\Permission\toArray().
BristolSU\Support\Permissions\Models\Permission::getName | ( | ) |
Get the name of the permission
Implements BristolSU\Support\Permissions\Contracts\Models\Permission.
Definition at line 107 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\$name.
Referenced by BristolSU\Support\Permissions\Models\Permission\toArray().
BristolSU\Support\Permissions\Models\Permission::getType | ( | ) |
Get the type of the permission
Implements BristolSU\Support\Permissions\Contracts\Models\Permission.
Definition at line 149 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\$type.
Referenced by BristolSU\Support\Permissions\Models\Permission\toArray().
BristolSU\Support\Permissions\Models\Permission::setAbility | ( | string | $ability | ) |
Set the ability string of the permission
string | $ability | New ability string |
Implements BristolSU\Support\Permissions\Contracts\Models\Permission.
Definition at line 97 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\$ability.
Referenced by BristolSU\Support\Permissions\Models\Permission\__construct().
BristolSU\Support\Permissions\Models\Permission::setDescription | ( | string | $description | ) |
Set the description of the permission
string | $description | New description |
Implements BristolSU\Support\Permissions\Contracts\Models\Permission.
Definition at line 139 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\$description.
Referenced by BristolSU\Support\Permissions\Models\Permission\__construct().
BristolSU\Support\Permissions\Models\Permission::setModuleAlias | ( | ?string | $moduleAlias | ) |
Set the module alias the permission belongs to
string | null | $moduleAlias | New module alias |
Implements BristolSU\Support\Permissions\Contracts\Models\Permission.
Definition at line 181 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\$moduleAlias.
Referenced by BristolSU\Support\Permissions\Models\Permission\__construct().
BristolSU\Support\Permissions\Models\Permission::setModuleType | ( | ?string | $moduleType | ) |
Set the type of module permission, administrator or participant
null | string | $moduleType | Administrator or participant |
Implements BristolSU\Support\Permissions\Contracts\Models\Permission.
Definition at line 202 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\$moduleType.
Referenced by BristolSU\Support\Permissions\Models\Permission\__construct().
BristolSU\Support\Permissions\Models\Permission::setName | ( | string | $name | ) |
Set the name of the permission
string | $name | New name |
Implements BristolSU\Support\Permissions\Contracts\Models\Permission.
Definition at line 118 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\$name.
Referenced by BristolSU\Support\Permissions\Models\Permission\__construct().
BristolSU\Support\Permissions\Models\Permission::setType | ( | string | $type | ) |
Set the type of the permission.
string | $type | One of global or module |
Implements BristolSU\Support\Permissions\Contracts\Models\Permission.
Definition at line 160 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\$type.
Referenced by BristolSU\Support\Permissions\Models\Permission\__construct().
BristolSU\Support\Permissions\Models\Permission::toArray | ( | ) |
Get the permission represented as an array
Definition at line 212 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\getAbility(), BristolSU\Support\Permissions\Models\Permission\getDescription(), BristolSU\Support\Permissions\Models\Permission\getModuleAlias(), BristolSU\Support\Permissions\Models\Permission\getModuleType(), BristolSU\Support\Permissions\Models\Permission\getName(), and BristolSU\Support\Permissions\Models\Permission\getType().
Referenced by BristolSU\Support\Permissions\Models\Permission\toJson().
BristolSU\Support\Permissions\Models\Permission::toJson | ( | $options = 0 | ) |
Get the permission in a JSON representation
int | $options | See json_encode options for more information |
Definition at line 230 of file Permission.php.
References BristolSU\Support\Permissions\Models\Permission\toArray().
Referenced by BristolSU\Support\Permissions\Models\Permission\__toString().
|
private |
Definition at line 20 of file Permission.php.
Referenced by BristolSU\Support\Permissions\Models\Permission\__construct(), BristolSU\Support\Permissions\Models\Permission\getAbility(), and BristolSU\Support\Permissions\Models\Permission\setAbility().
|
private |
Definition at line 34 of file Permission.php.
Referenced by BristolSU\Support\Permissions\Models\Permission\__construct(), BristolSU\Support\Permissions\Models\Permission\getDescription(), and BristolSU\Support\Permissions\Models\Permission\setDescription().
|
private |
Definition at line 50 of file Permission.php.
Referenced by BristolSU\Support\Permissions\Models\Permission\getModuleAlias(), and BristolSU\Support\Permissions\Models\Permission\setModuleAlias().
|
private |
Definition at line 59 of file Permission.php.
Referenced by BristolSU\Support\Permissions\Models\Permission\__construct(), BristolSU\Support\Permissions\Models\Permission\getModuleType(), and BristolSU\Support\Permissions\Models\Permission\setModuleType().
|
private |
Definition at line 27 of file Permission.php.
Referenced by BristolSU\Support\Permissions\Models\Permission\__construct(), BristolSU\Support\Permissions\Models\Permission\getName(), and BristolSU\Support\Permissions\Models\Permission\setName().
|
private |
Definition at line 43 of file Permission.php.
Referenced by BristolSU\Support\Permissions\Models\Permission\__construct(), BristolSU\Support\Permissions\Models\Permission\getType(), and BristolSU\Support\Permissions\Models\Permission\setType().