Class Horde_Share_sql

Description

Located in /Share/Share/sql.php (line 27)

Horde_Share
   |
   --Horde_Share_sql
Direct descendents
Variable Summary
 DB $_db
 mixed $_params
 string $_shareObject
 string $_table
Method Summary
 void getTable ()
 void &getWriteDb ()
 array listAllShares ()
 array &listShares (string $userid, [integer $perm = PERMS_SHOW], [mixed $attributes = null], [ $from = 0], [ $count = 0], [ $sort_by = null], [ $direction = 0])
 void _addShare ( &$share, Horde_Share_Object_sql $share)
 array _buildPermsFromRow (array $row, string $index)
 boolean _connect ()
 integer _countShares (string $userid, [integer $perm = PERMS_SHOW], [mixed $attributes = null])
 boolean _exists (string $share)
 void _fromDriverCharset ( $data)
 Horde_Share_Object_sql &_getShareById ( $id, integer $cid)
 string _getShareCriteria (string $userid, [integer $perm = PERMS_SHOW], [mixed $attributes = null])
 void _getShareGroups ( &$share, array $share)
 void _getSharePerms ( &$data)
 array &_getShares ( $ids, array $cids)
 void _getShareUsers ( &$share, array $share)
 void _hasGroups ( $share)
 void _hasUsers ( $share)
 array &_listAllShares ()
 void _loadPermissions ( &$data, array $data)
 void _removeShare ( &$share, Horde_Share_Object_sql $share)
 void _selectDB ( &$db,  $scope,  $message, [ $is_manip = null])
 void _toDriverCharset ( $data)
 array _toDriverKeys (array $data)
 array __sleep ()
 void __wakeup ()
Variables
DB $_db (line 34)

Handle for the current database connection.

mixed $_params = array() (line 47)

SQL connection parameters

string $_shareObject = 'Horde_Share_Object_sql' (line 61)

The Horde_Share_Object subclass to instantiate objects as


Redefined in descendants as:
string $_table (line 54)

Main share table for the current scope.

DB $_write_db (line 42)

Handle for the current database connection, used for writing. Defaults to the same handle as $db if a separate write database is not required.

Inherited Variables

Inherited from Horde_Share

Horde_Share::$_app
Horde_Share::$_cache
Horde_Share::$_listcache
Horde_Share::$_root
Horde_Share::$_shareMap
Horde_Share::$_sortList
Methods
getTable (line 95)

Get storage table

void getTable ()
getWriteDb (line 103)

Refetence to write db

void &getWriteDb ()
listAllShares (line 364)

Lists *all* shares for the current app/share, regardless of permissions.

This is for admin functionality and scripting tools, and shouldn't be called from user-level code!

  • return: All shares for the current app/share.
array listAllShares ()

Redefinition of:
Horde_Share::listAllShares()
Lists *all* shares for the current app/share, regardless of permissions.
listShares (line 440)

Returns an array of all shares that $userid has access to.

  • return: The shares the user has access to.
array &listShares (string $userid, [integer $perm = PERMS_SHOW], [mixed $attributes = null], [ $from = 0], [ $count = 0], [ $sort_by = null], [ $direction = 0])
  • string $userid: The userid of the user to check access for.
  • integer $perm: The level of permissions required.
  • mixed $attributes: Restrict the shares counted to those matching $attributes. An array of attribute/values pairs or a share owner username.
  • $from
  • $count
  • $sort_by
  • $direction

Redefinition of:
Horde_Share::listShares()
Returns an array of all shares that $userid has access to.

Redefined in descendants as:
_addShare (line 594)

Adds a share to the shares system.

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

void _addShare ( &$share, Horde_Share_Object_sql $share)
_buildPermsFromRow (line 850)

Builds a list of permission bit masks from the "perm" column.

  • return: A permission hash.
array _buildPermsFromRow (array $row, string $index)
  • array $row: A data row including permission columns.
  • string $index: Name of the column that should be used as the key for the permissions list.

Redefined in descendants as:
_connect (line 747)

Attempts to open a connection to the sql server.

  • return: True on success; exits (Horde::fatal()) on error.
boolean _connect ()
_countShares (line 564)

Returns the number of shares that $userid has access to.

  • return: The number of shares
integer _countShares (string $userid, [integer $perm = PERMS_SHOW], [mixed $attributes = null])
  • string $userid: The userid of the user to check access for.
  • integer $perm: The level of permissions required.
  • mixed $attributes: Restrict the shares counted to those matching $attributes. An array of attribute/values pairs or a share owner username.
_exists (line 636)

Checks if a share exists in the system.

  • return: True if the share exists.
boolean _exists (string $share)
  • string $share: The share to check.
_fromDriverCharset (line 858)

Utility function to convert from the SQL server's charset.

void _fromDriverCharset ( $data)
  • $data
_getShare (line 186)

Returns a Horde_Share_Object_sql object corresponding to the given share name, with the details retrieved appropriately.

  • return: The requested share.
Horde_Share_Object_sql &_getShare (string $name)
  • string $name: The name of the share to retrieve.
_getShareById (line 246)

Returns a Horde_Share_Object_sql object corresponding to the given unique ID, with the details retrieved appropriately.

  • return: The requested share.
Horde_Share_Object_sql &_getShareById ( $id, integer $cid)
  • integer $cid: The id of the share to retrieve.
  • $id
_getShareCriteria (line 670)

Returns an array of criteria for querying shares.

  • return: The criteria string for fetching this user's shares.
  • access: protected
string _getShareCriteria (string $userid, [integer $perm = PERMS_SHOW], [mixed $attributes = null])
  • string $userid: The userid of the user to check access for.
  • integer $perm: The level of permissions required.
  • mixed $attributes: Restrict the shares returned to those who have these attribute values.

Redefined in descendants as:
_getShareGroups (line 155)

Get groups permissions

void _getShareGroups ( &$share, array $share)
  • array $share: Share data array
  • &$share
_getSharePerms (line 229)
void _getSharePerms ( &$data)
  • &$data

Redefined in descendants as:
_getShares (line 289)

Returns an array of Horde_Share_Object_sql objects corresponding to the given set of unique IDs, with the details retrieved appropriately.

  • return: The requested shares.
array &_getShares ( $ids, array $cids)
  • array $cids: The array of ids to retrieve.
  • $ids

Redefined in descendants as:
_getShareUsers (line 129)

Get users permissions

void _getShareUsers ( &$share, array $share)
  • array $share: Share data array
  • &$share
_hasGroups (line 119)

Finds out if the share has user set

void _hasGroups ( $share)
  • $share
_hasUsers (line 111)

Finds out if the share has user set

void _hasUsers ( $share)
  • $share
_listAllShares (line 375)

Lists *all* shares for the current app/share, regardless of permissions.

  • return: All shares for the current app/share.
array &_listAllShares ()
_loadPermissions (line 223)

Helper function to load the permissions data into the share data

void _loadPermissions ( &$data, array $data)
  • array $data: Array of share attributes
  • &$data
_newShare (line 579)

Returns a new share object.

  • return: A new share object.
Horde_Share_Object_sql &_newShare (string $name)
  • string $name: The share's name.

Redefined in descendants as:
_removeShare (line 604)

Removes a share from the shares system permanently.

void _removeShare ( &$share, Horde_Share_Object_sql $share)
_selectDB (line 735)

Resets the current database name so that MDB2 is always selecting the database before sending a query.

void _selectDB ( &$db,  $scope,  $message, [ $is_manip = null])
  • &$db
  • $scope
  • $message
  • $is_manip
_toDriverCharset (line 873)

Utility function to convert TO the SQL server's charset.

void _toDriverCharset ( $data)
  • $data
_toDriverKeys (line 897)

Convert an array keyed on client keys to an array keyed on the driver keys.

  • return: The driver keyed array.
array _toDriverKeys (array $data)
  • array $data: The client code keyed array.
__sleep (line 83)

Returns the properties that need to be serialized.

  • return: List of serializable properties.
array __sleep ()

Redefinition of:
Horde_Share::__sleep()
Returns the properties that need to be serialized.
__wakeup (line 66)

Initializes the object.

void __wakeup ()

Redefinition of:
Horde_Share::__wakeup()
Initializes the object.

Inherited Methods

Inherited From Horde_Share

 Horde_Share::Horde_Share()
 Horde_Share::addShare()
 Horde_Share::countShares()
 Horde_Share::exists()
 Horde_Share::getIdentityByShare()
 Horde_Share::getPermissions()
 Horde_Share::getShare()
 Horde_Share::getShareById()
 Horde_Share::getShares()
 Horde_Share::listAllShares()
 Horde_Share::listShares()
 Horde_Share::newShare()
 Horde_Share::removeShare()
 Horde_Share::shutdown()
 Horde_Share::singleton()
 Horde_Share::_sortShares()
 Horde_Share::__sleep()
 Horde_Share::__wakeup()

Documentation generated on Sun, 30 Jan 2011 05:21:48 +0000 by phpDocumentor 1.4.3