PHP Class UserType

Inheritance: extends Eloquent
Afficher le fichier Open project: sourcefabric/newscoop Class Usage Examples

Méthodes publiques

Свойство Type Description
$m_columnNames
$m_config
$m_dbTableName
$m_exists
$m_keyColumnNames
$m_keyIsAutoIncrement

Méthodes publiques

Méthode Description
GetByName ( $p_name ) : mixed Get the user type that matches the given name.
GetUserTypeFromConfig ( $p_configVars ) : mixed Get the user type that matches the given config variables.
GetUserTypes ( ) : array Get all the user types with the exception of those with the Reader permission.
UserType ( $p_userTypeId = null ) : void Constructor
create ( $p_name = null, $p_configVars = [] ) : boolean Create the new UserType with the config variables given.
delete ( ) : boolean Delete the user type.
exists ( ) : boolean Whether the user type exists or not
getConfig ( ) : array Return an array of config values in the form array("varname" => "value");
getId ( ) : integer Get the id of this user type.
getName ( ) : string Get the name of this user type.
getValue ( string $p_varName ) : mixed Return the value of the given variable name.
hasPermission ( string $p_permissionString ) : boolean Return true if the user type has the permission specified.
setPermission ( $p_permissionString, $p_permissionValue ) Set the specified permission.
setValue ( string $p_varName, mixed $p_value ) : void Set the default config value for the given variable.

Method Details

GetByName() public static méthode

Get the user type that matches the given name.
public static GetByName ( $p_name ) : mixed
$p_name The name of the user type
Résultat mixed null If the user type does not exists or any error UserType object

GetUserTypeFromConfig() public static méthode

Get the user type that matches the given config variables.
public static GetUserTypeFromConfig ( $p_configVars ) : mixed
$p_configVars An array of permissions variables
Résultat mixed bool False The config passed does not match any user type object $userType The user type object matching

GetUserTypes() public static méthode

Get all the user types with the exception of those with the Reader permission.
public static GetUserTypes ( ) : array
Résultat array An array of UserType objects.

UserType() public méthode

Constructor
public UserType ( $p_userTypeId = null ) : void
$p_userTypeId (optional) The user type identifier
Résultat void

create() public méthode

If a config variable is not set, the default value will be used.
public create ( $p_name = null, $p_configVars = [] ) : boolean
$p_configVars The privileges list to be granted
Résultat boolean TRUE on success, FALSE on failure

delete() public méthode

Delete the user type.
public delete ( ) : boolean
Résultat boolean TRUE on success, FALSE on failure

exists() public méthode

Whether the user type exists or not
public exists ( ) : boolean
Résultat boolean $this->m_exists TRUE on success, FALSE on failure

getConfig() public méthode

Return an array of config values in the form array("varname" => "value");
public getConfig ( ) : array
Résultat array

getId() public méthode

Get the id of this user type.
public getId ( ) : integer
Résultat integer

getName() public méthode

Get the name of this user type.
public getName ( ) : string
Résultat string

getValue() public méthode

If the variable name does not exist, return null.
public getValue ( string $p_varName ) : mixed
$p_varName string
Résultat mixed

hasPermission() public méthode

Return true if the user type has the permission specified.
public hasPermission ( string $p_permissionString ) : boolean
$p_permissionString string
Résultat boolean

setPermission() public méthode

Set the specified permission.
public setPermission ( $p_permissionString, $p_permissionValue )
$p_permissionString
$p_permissionValue

setValue() public méthode

This creates the new config variable if it didn't exist.
public setValue ( string $p_varName, mixed $p_value ) : void
$p_varName string
$p_value mixed
Résultat void

Property Details

$m_columnNames public_oe property

public $m_columnNames

$m_config public_oe property

public $m_config

$m_dbTableName public_oe property

public $m_dbTableName

$m_exists public_oe property

public $m_exists

$m_keyColumnNames public_oe property

public $m_keyColumnNames

$m_keyIsAutoIncrement public_oe property

public $m_keyIsAutoIncrement