__construct() 공개 메소드

Constructor.
public __construct ( array $params = [] )
$params array Configuration parameters the driver needs.
예제 #1
0
파일: Mongo.php 프로젝트: raz0rsdge/horde
 /**
  * @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']);
 }
예제 #2
0
파일: Sql.php 프로젝트: DSNS-LAB/Dmail
 /**
  * @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);
 }