/** * Const'r * * @param array $params Must contain: * - db: (Horde_Db_Adapter_Base) The Horde_Db instance. * * @return Horde_ActiveSync_State_Sql */ public function __construct(array $params = array()) { parent::__construct($params); if (empty($this->_params['db']) || !$this->_params['db'] instanceof Horde_Db_Adapter) { throw new InvalidArgumentException('Missing or invalid Horde_Db parameter.'); } $this->_syncStateTable = 'horde_activesync_state'; $this->_syncMapTable = 'horde_activesync_map'; $this->_syncDeviceTable = 'horde_activesync_device'; $this->_syncUsersTable = 'horde_activesync_device_users'; $this->_syncMailMapTable = 'horde_activesync_mailmap'; $this->_syncCacheTable = 'horde_activesync_cache'; $this->_db = $params['db']; }
/** * Const'r * * @param array $params Must contain: * - connection: (Horde_Mongo_Client The Horde_Mongo instance. * * @return Horde_ActiveSync_State_Sql */ public function __construct(array $params = array()) { parent::__construct($params); if (empty($this->_params['connection']) || !$this->_params['connection'] instanceof MongoClient) { throw new InvalidArgumentException('Missing or invalid connection parameter.'); } $this->_mongo = $params['connection']; $this->_db = $this->_mongo->selectDb(null); }