PHP Class Horde_Group_Base, horde

Author: Jan Schneider ([email protected])
Datei anzeigen Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_cache Horde_Cache Cache object.

Public Methods

Method Description
__construct ( $params = [] ) Constructor.
addUser ( mixed $gid, string $user ) Add a user to a group.
create ( string $name, string $email = null ) : mixed Creates a new group.
exists ( mixed $gid ) : boolean Checks if a group exists.
getCache ( ) : Horde_Cache Returns the cache object.
getData ( mixed $gid ) : array Returns all available attributes of a group.
getName ( mixed $gid ) : string Returns a group name.
listAll ( string $member = null ) : array Returns a list of all groups a user may see, with IDs as keys and names as values.
listGroups ( string $user ) : array Returns a list of groups a user belongs to.
listUsers ( mixed $gid ) : array Returns a list of users in a group.
readOnly ( ) : boolean Returns whether the group backend is read-only.
remove ( mixed $gid ) Removes a group.
removeUser ( mixed $gid, string $user ) Removes a user from a group.
rename ( mixed $gid, string $name ) Renames a group.
renameSupported ( ) : boolean Returns whether groups can be renamed.
search ( string $name ) : array Searches for group names.
setCache ( Horde_Cache $cache ) Sets a cache object.
setData ( mixed $gid, array | string $attribute, string $value = null ) Sets one or more attributes of a group.

Protected Methods

Method Description
_addUser ( mixed $gid, string $user ) Add a user to a group.
_checkExistsCache ( $gid )
_create ( string $name, string $email = null ) : mixed Creates a new group.
_exists ( mixed $gid ) : boolean Checks if a group exists.
_getData ( mixed $gid ) : array Returns all available attributes of a group.
_getListCache ( string $user = null ) : array Returns the cached group list.
_getName ( mixed $gid ) : string Returns a group name.
_listAll ( ) : array Returns a list of all groups a user may see, with IDs as keys and names as values.
_listGroups ( string $user ) : array Returns a list of groups a user belongs to.
_listUsers ( mixed $gid ) : array Returns a list of users in a group.
_remove ( mixed $gid ) Removes a group.
_removeUser ( mixed $gid, string $user ) Removes a user from a group.
_rename ( mixed $gid, string $name ) Renames a group.
_search ( string $name ) : array Searches for group names.
_setData ( mixed $gid, array | string $attribute, string $value = null ) Sets one or more attributes of a group.
_setListCache ( array $list, string $user = null ) Sets the cached group list.
_sig ( string $key ) : string Returns a full cache key.

Method Details

__construct() public method

Constructor.
public __construct ( $params = [] )

_addUser() protected method

Add a user to a group.
protected _addUser ( mixed $gid, string $user )
$gid mixed A group ID.
$user string A user name.

_checkExistsCache() protected method

protected _checkExistsCache ( $gid )

_create() protected method

Creates a new group.
protected _create ( string $name, string $email = null ) : mixed
$name string A group name.
$email string The group's email address.
return mixed The ID of the created group.

_exists() abstract protected method

Checks if a group exists.
abstract protected _exists ( mixed $gid ) : boolean
$gid mixed A group ID.
return boolean True if the group exists.

_getData() abstract protected method

Returns all available attributes of a group.
abstract protected _getData ( mixed $gid ) : array
$gid mixed A group ID.
return array The group's date.

_getListCache() protected method

Returns the cached group list.
protected _getListCache ( string $user = null ) : array
$user string A user name.
return array The group list or null if not cached.

_getName() abstract protected method

Returns a group name.
abstract protected _getName ( mixed $gid ) : string
$gid mixed A group ID.
return string The group's name.

_listAll() abstract protected method

Returns a list of all groups a user may see, with IDs as keys and names as values.
abstract protected _listAll ( ) : array
return array All existing groups.

_listGroups() abstract protected method

Returns a list of groups a user belongs to.
abstract protected _listGroups ( string $user ) : array
$user string A user name.
return array A list of groups, with IDs as keys and names as values.

_listUsers() abstract protected method

Returns a list of users in a group.
abstract protected _listUsers ( mixed $gid ) : array
$gid mixed A group ID.
return array List of group users.

_remove() protected method

Removes a group.
protected _remove ( mixed $gid )
$gid mixed A group ID.

_removeUser() protected method

Removes a user from a group.
protected _removeUser ( mixed $gid, string $user )
$gid mixed A group ID.
$user string A user name.

_rename() protected method

Renames a group.
protected _rename ( mixed $gid, string $name )
$gid mixed A group ID.
$name string The new name.

_setData() protected method

Sets one or more attributes of a group.
protected _setData ( mixed $gid, array | string $attribute, string $value = null )
$gid mixed A group ID.
$attribute array | string An attribute name or a hash of attributes.
$value string An attribute value if $attribute is a string.

_setListCache() protected method

Sets the cached group list.
protected _setListCache ( array $list, string $user = null )
$list array A group list.
$user string A user name.

_sig() protected method

Returns a full cache key.
protected _sig ( string $key ) : string
$key string The internal key.
return string The full key for Horde_Cache consumption.

addUser() public method

Add a user to a group.
public addUser ( mixed $gid, string $user )
$gid mixed A group ID.
$user string A user name.

create() public method

Creates a new group.
public create ( string $name, string $email = null ) : mixed
$name string A group name.
$email string The group's email address.
return mixed The ID of the created group.

exists() public method

Checks if a group exists.
public exists ( mixed $gid ) : boolean
$gid mixed A group ID.
return boolean True if the group exists.

getCache() public method

Returns the cache object.
public getCache ( ) : Horde_Cache
return Horde_Cache

getData() public method

Returns all available attributes of a group.
public getData ( mixed $gid ) : array
$gid mixed A group ID.
return array The group's data.

getName() public method

Returns a group name.
public getName ( mixed $gid ) : string
$gid mixed A group ID.
return string The group's name.

listAll() public method

Returns a list of all groups a user may see, with IDs as keys and names as values.
public listAll ( string $member = null ) : array
$member string Only return groups that this user is a member of.
return array All existing groups.

listGroups() public method

Returns a list of groups a user belongs to.
public listGroups ( string $user ) : array
$user string A user name.
return array A list of groups, with IDs as keys and names as values.

listUsers() public method

Returns a list of users in a group.
public listUsers ( mixed $gid ) : array
$gid mixed A group ID.
return array List of group users.

readOnly() public method

Returns whether the group backend is read-only.
public readOnly ( ) : boolean
return boolean

remove() public method

Removes a group.
public remove ( mixed $gid )
$gid mixed A group ID.

removeUser() public method

Removes a user from a group.
public removeUser ( mixed $gid, string $user )
$gid mixed A group ID.
$user string A user name.

rename() public method

Renames a group.
public rename ( mixed $gid, string $name )
$gid mixed A group ID.
$name string The new name.

renameSupported() public method

Returns whether groups can be renamed.
public renameSupported ( ) : boolean
return boolean

setCache() public method

Sets a cache object.
public setCache ( Horde_Cache $cache )
$cache Horde_Cache The cache object.

setData() public method

Sets one or more attributes of a group.
public setData ( mixed $gid, array | string $attribute, string $value = null )
$gid mixed A group ID.
$attribute array | string An attribute name or a hash of attributes.
$value string An attribute value if $attribute is a string.

Property Details

$_cache protected_oe property

Cache object.
protected Horde_Cache $_cache
return Horde_Cache