Horde_Perms_Base::__construct PHP Method

__construct() public method

Constructor.
public __construct ( array $params = [] )
$params array Configuration parameters:
'cache' - (Horde_Cache) The object to use to cache perms.
'logger' - (Horde_Log_Logger) A logger object.
    public function __construct($params = array())
    {
        if (isset($params['cache'])) {
            $this->_cache = $params['cache'];
        }
        if (isset($params['logger'])) {
            $this->_logger = $params['logger'];
        }
    }

Usage Example

Esempio n. 1
0
 /**
  * Constructor.
  *
  * @param array $params  Configuration parameters (in addition to base
  *                       Horde_Perms parameters):
  * <pre>
  * 'db' - (Horde_Db_Adapter) [REQUIRED] The DB instance.
  * 'table' - (string) The name of the perms table.
  *           DEFAULT: 'horde_perms'
  * </pre>
  *
  * @throws Horde_Perms_Exception
  */
 public function __construct($params = array())
 {
     if (!isset($params['db'])) {
         throw new Horde_Perms_Exception('Missing db parameter.');
     }
     $this->_db = $params['db'];
     unset($params['db']);
     $this->_params = array_merge(array('table' => 'horde_perms'), $this->_params, $params);
     parent::__construct($params);
 }