Overview

Packages

  • Prefs

Classes

  • Horde_Prefs
  • Horde_Prefs_Cache_Base
  • Horde_Prefs_Cache_Null
  • Horde_Prefs_Cache_Session
  • Horde_Prefs_CategoryManager
  • Horde_Prefs_Exception
  • Horde_Prefs_Identity
  • Horde_Prefs_Scope
  • Horde_Prefs_Storage_Base
  • Horde_Prefs_Storage_File
  • Horde_Prefs_Storage_Imsp
  • Horde_Prefs_Storage_KolabImap
  • Horde_Prefs_Storage_Ldap
  • Horde_Prefs_Storage_Null
  • Horde_Prefs_Storage_Sql
  • Horde_Prefs_Translation
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Storage driver for the preferences system.
  4:  *
  5:  * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
  6:  *
  7:  * See the enclosed file COPYING for license information (LGPL). If you
  8:  * did not receive this file, see http://www.horde.org/licenses/lgpl21.
  9:  *
 10:  * @author   Michael Slusarz <slusarz@horde.org>
 11:  * @category Horde
 12:  * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
 13:  * @package  Prefs
 14:  */
 15: abstract class Horde_Prefs_Storage_Base
 16: {
 17:     /**
 18:      * Configuration parameters.
 19:      * 'user' is always available as an entry.
 20:      *
 21:      * @var string
 22:      */
 23:     protected $_params = array();
 24: 
 25:     /**
 26:      * Constructor.
 27:      *
 28:      * @param string $user   The username.
 29:      * @param array $params  Additional configuration parameters.
 30:      */
 31:     public function __construct($user, array $params = array())
 32:     {
 33:         $this->_params = array_merge($this->_params, $params);
 34:         $this->_params['user'] = $user;
 35:     }
 36: 
 37:     /**
 38:      * Get the list of driver parameters.
 39:      *
 40:      * @return array  Driver parameters.
 41:      */
 42:     public function getParams()
 43:     {
 44:         return $this->_params;
 45:     }
 46: 
 47:     /**
 48:      * Retrieves the requested preferences scope from the storage backend.
 49:      *
 50:      * @param Horde_Prefs_Scope $scope_ob  The scope object.
 51:      *
 52:      * @return Horde_Prefs_Scope  The modified scope object.
 53:      * @throws Horde_Prefs_Exception
 54:      */
 55:     abstract public function get($scope_ob);
 56: 
 57:     /**
 58:      * Stores changed preferences in the storage backend.
 59:      *
 60:      * @param Horde_Prefs_Scope $scope_ob  The scope object.
 61:      *
 62:      * @throws Horde_Prefs_Exception
 63:      */
 64:     abstract public function store($scope_ob);
 65: 
 66:     /**
 67:      * Called whenever a preference value is changed.
 68:      *
 69:      * @param string $scope  Scope specifier.
 70:      * @param string $pref   The preference name.
 71:      */
 72:     public function onChange($scope, $pref)
 73:     {
 74:     }
 75: 
 76:     /**
 77:      * Removes preferences from the backend.
 78:      *
 79:      * @param string $scope  The scope of the prefs to clear. If null, clears
 80:      *                       all scopes.
 81:      * @param string $pref   The pref to clear. If null, clears the entire
 82:      *                       scope.
 83:      *
 84:      * @throws Horde_Prefs_Exception
 85:      */
 86:     abstract public function remove($scope = null, $pref = null);
 87: 
 88:     /**
 89:      * Lists all available scopes.
 90:      *
 91:      * @since Horde_Prefs 1.1.0
 92:      *
 93:      * @return array The list of scopes stored in the backend.
 94:      */
 95:     public function listScopes()
 96:     {
 97:         throw new Horde_Prefs_Exception('Not implemented!');
 98:     }
 99: 
100: }
101: 
API documentation generated by ApiGen