PHP 클래스 Horde_Share_Sql, horde

상속: extends Horde_Share_Base
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_clobFields array Local cache of text/clob fields
$_db Horde_Db_Adapter Handle for the current database connection.
$_nonClobFields array Local cache of non-text/clob fields
$_shareObject string The Horde_Share_Object subclass to instantiate objects as
$_table string Main share table for the current scope.

공개 메소드들

메소드 설명
__construct ( $app, $user, Horde_Perms_Base $perms, Horde_Group_Base $groups )
countOwners ( integer $perm = Horde_Perms::SHOW, mixed $parent = null, boolean $allLevels = true ) : integer Count the number of users who have shares with the given permissions for the current user.
countShares ( string $userid, integer $perm = Horde_Perms::SHOW, mixed $attributes = null, mixed $parent = null, boolean $allLevels = true ) : integer Returns the count of all shares that $userid has access to.
getParent ( Horde_Share_Object $child ) : Horde_Share_Object Returns a share's direct parent object.
getShareCriteria ( string $userid, integer $perm = Horde_Perms::SHOW, mixed $attributes = null, mixed $parent = null, boolean $allLevels = true ) : string Returns an array of criteria for querying shares.
getStorage ( ) : Horde_Db_Adapter
getTable ( ) : string Get storage table
listAllShares ( ) : array Lists *all* shares for the current app/share, regardless of permissions.
listOwners ( integer $perm = Horde_Perms::SHOW, mixed $parent = null, boolean $allLevels = true, integer $from, integer $count ) : array Return a list of users who have shares with the given permissions for the current user.
listShares ( string $userid, array $params = [] ) : array Returns an array of all shares that $userid has access to.
listSystemShares ( ) : array Returns an array of all system shares.
removeShare ( Horde_Share_Object $share ) Removes a share from the shares system permanently.
setStorage ( Horde_Db_Adapter $db )
setTable ( $table ) Set the SQL table name to use for the current scope's share storage.
toDriverCharset ( $data ) Utility function to convert TO the SQL server's charset.

보호된 메소드들

메소드 설명
_addShare ( Horde_Share_Object $share ) Adds a share to the shares system.
_buildPermsFromRow ( array $row ) : integer Builds a permission bit mask from the "perm" column.
_convertClobs ( &$data ) Convert clob data to string.
_createObject ( array $data = [] )
_exists ( string $share ) : boolean Checks if a share exists in the system.
_fetchClobFields ( &$shares ) Fetch data for all clob fields of each share passed in $shares.
_fromDriverCharset ( $data ) Utility function to convert from the SQL server's charset.
_getClobFields ( ) : array Return a list of fields in the table that ARE text/clob fields.
_getDistinctClause ( ) : string Return a DISTINCT clause containing all non-clob field names.
_getNonClobFields ( ) : array Return a list of fields in the table that are NOT text/clob fields.
_getShare ( string $name ) : Horde_Share_Object Returns a Horde_Share_Object_sql object corresponding to the given share name, with the details retrieved appropriately.
_getShareById ( integer $id ) : Horde_Share_Object_sql Returns a Horde_Share_Object_sql object corresponding to the given unique ID, with the details retrieved appropriately.
_getShareGroups ( array &$share ) Get groups permissions
_getSharePerms ( &$data )
_getShareUsers ( array &$share ) Get users permissions
_getShares ( array $ids ) : array Returns an array of Horde_Share_Object objects corresponding to the given set of unique IDs, with the details retrieved appropriately.
_getUserAndGroupCriteria ( string $userid, integer $perm = Horde_Perms::SHOW ) : array Returns criteria statement fragments for querying shares.
_hasGroups ( $share ) Finds out if the share has user set
_hasUsers ( $share ) Finds out if the share has user set
_idExists ( integer $id ) : boolean Check that a share id exists in the system.
_listAllShares ( ) : array Lists *all* shares for the current app/share, regardless of permissions.
_listShares ( string $userid, array $params = [] ) : array Returns an array of all shares that $userid has access to.
_loadPermissions ( array &$data ) Helper function to load the permissions data into the share data
_newShare ( string $name ) : Horde_Share_Object Returns a new share object.
_removeShare ( Horde_Share_Object $share ) : boolean Removes a share from the shares system permanently.
_renameShare ( Horde_Share_Object $share, string $name ) Renames a share in the shares system.
_toDriverKeys ( array $data ) : array Convert an array keyed on client keys to an array keyed on the driver keys.

메소드 상세

__construct() 공개 메소드

또한 보기: Horde_Share_Base::__construct()
public __construct ( $app, $user, Horde_Perms_Base $perms, Horde_Group_Base $groups )
$perms Horde_Perms_Base
$groups Horde_Group_Base

_addShare() 보호된 메소드

The share must first be created with Horde_Share_sql::_newShare(), and have any initial details added to it, before this function is called.
protected _addShare ( Horde_Share_Object $share )
$share Horde_Share_Object The new share object.

_buildPermsFromRow() 보호된 메소드

Builds a permission bit mask from the "perm" column.
protected _buildPermsFromRow ( array $row ) : integer
$row array A data row including permission columns.
리턴 integer A permission mask.

_convertClobs() 보호된 메소드

Convert clob data to string.
protected _convertClobs ( &$data )

_createObject() 보호된 메소드

protected _createObject ( array $data = [] )
$data array

_exists() 보호된 메소드

Checks if a share exists in the system.
protected _exists ( string $share ) : boolean
$share string The share to check.
리턴 boolean True if the share exists.

_fetchClobFields() 보호된 메소드

Fetch data for all clob fields of each share passed in $shares.
protected _fetchClobFields ( &$shares )

_fromDriverCharset() 보호된 메소드

Utility function to convert from the SQL server's charset.
protected _fromDriverCharset ( $data )

_getClobFields() 보호된 메소드

Return a list of fields in the table that ARE text/clob fields.
protected _getClobFields ( ) : array
리턴 array An array of clob field names.

_getDistinctClause() 보호된 메소드

Return a DISTINCT clause containing all non-clob field names.
protected _getDistinctClause ( ) : string
리턴 string The DISTINCT clause.

_getNonClobFields() 보호된 메소드

Return a list of fields in the table that are NOT text/clob fields.
protected _getNonClobFields ( ) : array
리턴 array An array of non-clob field names.

_getShare() 보호된 메소드

Returns a Horde_Share_Object_sql object corresponding to the given share name, with the details retrieved appropriately.
protected _getShare ( string $name ) : Horde_Share_Object
$name string The name of the share to retrieve.
리턴 Horde_Share_Object The requested share.

_getShareById() 보호된 메소드

Returns a Horde_Share_Object_sql object corresponding to the given unique ID, with the details retrieved appropriately.
protected _getShareById ( integer $id ) : Horde_Share_Object_sql
$id integer The id of the share to retrieve.
리턴 Horde_Share_Object_sql The requested share.

_getShareGroups() 보호된 메소드

Get groups permissions
protected _getShareGroups ( array &$share )
$share array Share data array

_getSharePerms() 보호된 메소드

protected _getSharePerms ( &$data )

_getShareUsers() 보호된 메소드

Get users permissions
protected _getShareUsers ( array &$share )
$share array Share data array

_getShares() 보호된 메소드

Returns an array of Horde_Share_Object objects corresponding to the given set of unique IDs, with the details retrieved appropriately.
protected _getShares ( array $ids ) : array
$ids array The array of ids to retrieve.
리턴 array The requested shares.

_getUserAndGroupCriteria() 보호된 메소드

Returns criteria statement fragments for querying shares.
protected _getUserAndGroupCriteria ( string $userid, integer $perm = Horde_Perms::SHOW ) : array
$userid string The userid of the user to check access for.
$perm integer The level of permissions required.
리턴 array An array with query and where string fragments.

_hasGroups() 보호된 메소드

Finds out if the share has user set
protected _hasGroups ( $share )

_hasUsers() 보호된 메소드

Finds out if the share has user set
protected _hasUsers ( $share )

_idExists() 보호된 메소드

Check that a share id exists in the system.
protected _idExists ( integer $id ) : boolean
$id integer The share id
리턴 boolean True if the share exists.

_listAllShares() 보호된 메소드

Lists *all* shares for the current app/share, regardless of permissions.
protected _listAllShares ( ) : array
리턴 array All shares for the current app/share.

_listShares() 보호된 메소드

Returns an array of all shares that $userid has access to.
protected _listShares ( string $userid, array $params = [] ) : array
$userid string The userid of the user to check access for.
$params array See listShares().
리턴 array The shares the user has access to.

_loadPermissions() 보호된 메소드

Helper function to load the permissions data into the share data
protected _loadPermissions ( array &$data )
$data array Array of share attributes

_newShare() 보호된 메소드

Returns a new share object.
protected _newShare ( string $name ) : Horde_Share_Object
$name string The share's name.
리턴 Horde_Share_Object A new share object

_removeShare() 보호된 메소드

Removes a share from the shares system permanently.
protected _removeShare ( Horde_Share_Object $share ) : boolean
$share Horde_Share_Object The share to remove.
리턴 boolean

_renameShare() 보호된 메소드

Renames a share in the shares system.
protected _renameShare ( Horde_Share_Object $share, string $name )
$share Horde_Share_Object The share to rename.
$name string The share's new name.

_toDriverKeys() 보호된 메소드

Convert an array keyed on client keys to an array keyed on the driver keys.
protected _toDriverKeys ( array $data ) : array
$data array The client code keyed array.
리턴 array The driver keyed array.

countOwners() 공개 메소드

Count the number of users who have shares with the given permissions for the current user.
public countOwners ( integer $perm = Horde_Perms::SHOW, mixed $parent = null, boolean $allLevels = true ) : integer
$perm integer The level of permissions required.
$parent mixed The parent share to start looking in. (Horde_Share_Object, share_id, or null).
$allLevels boolean Return all levels, or just the direct children of $parent?
리턴 integer Number of users.

countShares() 공개 메소드

Returns the count of all shares that $userid has access to.
public countShares ( string $userid, integer $perm = Horde_Perms::SHOW, mixed $attributes = null, mixed $parent = null, boolean $allLevels = true ) : integer
$userid string The userid of the user to check access for.
$perm integer The level of permissions required.
$attributes mixed Restrict the shares counted to those matching $attributes. An array of attribute/values pairs or a share owner username.
$parent mixed The share to start searching from (Horde_Share_Object, share_id, or null)
$allLevels boolean Return all levels, or just the direct children of $parent?
리턴 integer Number of shares the user has access to.

getParent() 공개 메소드

Returns a share's direct parent object.
public getParent ( Horde_Share_Object $child ) : Horde_Share_Object
$child Horde_Share_Object The share to get parent for.
리턴 Horde_Share_Object The parent share, if it exists.

getShareCriteria() 공개 메소드

Returns an array of criteria for querying shares.
public getShareCriteria ( string $userid, integer $perm = Horde_Perms::SHOW, mixed $attributes = null, mixed $parent = null, boolean $allLevels = true ) : string
$userid string The userid of the user to check access for.
$perm integer The level of permissions required. Set to null to skip permission filtering.
$attributes mixed Restrict the shares returned to those who have these attribute values.
$parent mixed The share to start searching in. (A Horde_Share_Object, share_id or null)
$allLevels boolean Return all levels, or just the direct children of $parent? Defaults to all levels.
리턴 string The criteria string for fetching this user's shares.

getStorage() 공개 메소드

public getStorage ( ) : Horde_Db_Adapter
리턴 Horde_Db_Adapter

getTable() 공개 메소드

Get storage table
public getTable ( ) : string
리턴 string

listAllShares() 공개 메소드

This is for admin functionality and scripting tools, and shouldn't be called from user-level code!
public listAllShares ( ) : array
리턴 array All shares for the current app/share.

listOwners() 공개 메소드

Return a list of users who have shares with the given permissions for the current user.
public listOwners ( integer $perm = Horde_Perms::SHOW, mixed $parent = null, boolean $allLevels = true, integer $from, integer $count ) : array
$perm integer The level of permissions required.
$parent mixed The parent share to start looking in. (Horde_Share_Object, share_id, or null)
$allLevels boolean Return all levels, or just the direct children of $parent? Defaults to all levels.
$from integer The user to start listing at.
$count integer The number of users to return.
리턴 array List of users.

listShares() 공개 메소드

Returns an array of all shares that $userid has access to.
public listShares ( string $userid, array $params = [] ) : array
$userid string The userid of the user to check access for. An empty value for the userid will only return shares with guest access.
$params array Additional parameters for the search.
 'perm'          Require this level of permissions. Horde_Perms constant.
 'attribtues'    Restrict shares to these attributes. A hash or username.
 'from'          Offset. Start at this share
 'count'         Limit.  Only return this many.
 'sort_by'       Sort by attribute.
 'direction'     Sort by direction.
 'parent'        Start at this share in the hierarchy. Either share_id or
                 Horde_Share_Object
 'all_levels'    List all levels or just the direct children of parent?
리턴 array The shares the user has access to.

listSystemShares() 공개 메소드

Returns an array of all system shares.
public listSystemShares ( ) : array
리턴 array All system shares.

removeShare() 공개 메소드

Removes a share from the shares system permanently.
public removeShare ( Horde_Share_Object $share )
$share Horde_Share_Object The share to remove.

setStorage() 공개 메소드

public setStorage ( Horde_Db_Adapter $db )
$db Horde_Db_Adapter

setTable() 공개 메소드

Set the SQL table name to use for the current scope's share storage.
public setTable ( $table )

toDriverCharset() 공개 메소드

Utility function to convert TO the SQL server's charset.
public toDriverCharset ( $data )

프로퍼티 상세

$_clobFields 보호되어 있는 프로퍼티

Local cache of text/clob fields
protected array $_clobFields
리턴 array

$_db 보호되어 있는 프로퍼티

Handle for the current database connection.
protected Horde_Db_Adapter $_db
리턴 Horde_Db_Adapter

$_nonClobFields 보호되어 있는 프로퍼티

Local cache of non-text/clob fields
protected array $_nonClobFields
리턴 array

$_shareObject 보호되어 있는 프로퍼티

The Horde_Share_Object subclass to instantiate objects as
protected string $_shareObject
리턴 string

$_table 보호되어 있는 프로퍼티

Main share table for the current scope.
protected string $_table
리턴 string