/** * @param array $params Parameters: * - collection: (string) The name of the sentmail collection. * - mongo_db: (Horde_Mongo_Client) [REQUIRED] The DB instance. */ public function __construct(array $params = array()) { if (!isset($params['mongo_db'])) { throw new InvalidArgumentException('Missing mongo_db parameter.'); } parent::__construct(array_merge(array('collection' => 'imp_sentmail'), $params)); $this->_db = $this->_params['mongo_db']->selectCollection(null, $this->_params['collection']); }
/** * @param array $params Parameters: * - db: (Horde_Db_Adapter) [REQUIRED] The DB instance. * - table: (string) The name of the sentmail table. * DEFAULT: 'imp_sentmail' */ public function __construct(array $params = array()) { if (!isset($params['db'])) { throw new IMP_Exception('Missing db parameter.'); } $this->_db = $params['db']; unset($params['db']); $params = array_merge(array('table' => 'imp_sentmail'), $params); parent::__construct($params); }