PHP Класс Horde_Perms_Sql, horde

Copyright 2008-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Автор: Duck ([email protected])
Наследование: extends Horde_Perms_Base
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_db Horde_Db_Adapter Handle for the current database connection.
$_params array Configuration parameters.
$_permsCache array Cache of previously retrieved permissions.

Открытые методы

Метод Описание
__construct ( array $params = [] ) Constructor.
addPermission ( Horde_Perms_Permission $perm ) : integer Adds a permission to the permissions system. The permission must first be created with newPermission(), and have any initial users added to it, before this function is called.
exists ( string $permission ) : boolean Checks if a permission exists in the system.
getParent ( mixed $child ) : integer Returns a child's direct parent ID.
getParents ( string $child ) : array Returns a list of parent permissions.
getPermission ( string $name ) : Horde_Perms_Permission_Sql Returns an object corresponding to the named permission, with the users and other data retrieved appropriately.
getPermissionById ( integer $id ) : Horde_Perms_Permission_Sql Returns a permission object corresponding to the given unique ID, with the users and other data retrieved appropriately.
getPermissionId ( $permission ) : integer Returns the unique identifier of this permission.
getTree ( ) : array Returns all permissions of the system in a tree format.
newPermission ( string $name, string $type = 'matrix', array $params = null ) : Horde_Perms_Permission_Sql Returns a new permissions object.
removePermission ( Horde_Perms_Permission $perm, boolean $force = false ) : boolean Removes a permission from the permissions system permanently.

Защищенные методы

Метод Описание
_getParents ( $parents ) TODO

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( array $params = [] )
$params array Configuration parameters (in addition to base Horde_Perms parameters):
'db' - (Horde_Db_Adapter) [REQUIRED] The DB instance.
'table' - (string) The name of the perms table.
          DEFAULT: 'horde_perms'

_getParents() защищенный Метод

TODO
protected _getParents ( $parents )

addPermission() публичный Метод

Adds a permission to the permissions system. The permission must first be created with newPermission(), and have any initial users added to it, before this function is called.
public addPermission ( Horde_Perms_Permission $perm ) : integer
$perm Horde_Perms_Permission The perm object.
Результат integer Permission ID in the database.

exists() публичный Метод

Checks if a permission exists in the system.
public exists ( string $permission ) : boolean
$permission string The permission to check.
Результат boolean True if the permission exists.

getParent() публичный Метод

Returns a child's direct parent ID.
public getParent ( mixed $child ) : integer
$child mixed The object name for which to look up the parent's ID.
Результат integer The unique ID of the parent.

getParents() публичный Метод

Returns a list of parent permissions.
public getParents ( string $child ) : array
$child string The name of the child to retrieve parents for.
Результат array A hash with all parents in a tree format.

getPermission() публичный Метод

Returns an object corresponding to the named permission, with the users and other data retrieved appropriately.
public getPermission ( string $name ) : Horde_Perms_Permission_Sql
$name string The name of the permission to retrieve.
Результат Horde_Perms_Permission_Sql TODO

getPermissionById() публичный Метод

Returns a permission object corresponding to the given unique ID, with the users and other data retrieved appropriately.
public getPermissionById ( integer $id ) : Horde_Perms_Permission_Sql
$id integer The unique ID of the permission to retrieve.
Результат Horde_Perms_Permission_Sql TODO

getPermissionId() публичный Метод

Returns the unique identifier of this permission.
public getPermissionId ( $permission ) : integer
Результат integer The unique id.

getTree() публичный Метод

Returns all permissions of the system in a tree format.
public getTree ( ) : array
Результат array A hash with all permissions in a tree format.

newPermission() публичный Метод

Returns a new permissions object.
public newPermission ( string $name, string $type = 'matrix', array $params = null ) : Horde_Perms_Permission_Sql
$name string The permission's name.
$type string The permission type.
$params array The permission parameters.
Результат Horde_Perms_Permission_Sql A new permissions object.

removePermission() публичный Метод

Removes a permission from the permissions system permanently.
public removePermission ( Horde_Perms_Permission $perm, boolean $force = false ) : boolean
$perm Horde_Perms_Permission The permission to remove.
$force boolean Force to remove every child.
Результат boolean True if permission was deleted.

Описание свойств

$_db защищенное свойство

Handle for the current database connection.
protected Horde_Db_Adapter $_db
Результат Horde_Db_Adapter

$_params защищенное свойство

Configuration parameters.
protected array $_params
Результат array

$_permsCache защищенное свойство

Cache of previously retrieved permissions.
protected array $_permsCache
Результат array