Beispiel #1
0
 /**
  * Constructor.
  *
  * @param   string                    $table  Table name.
  * @param   string|array              $pk     Primary key.
  * @param   DatabaseAdapterInterface  $db     Database adapter.
  */
 public function __construct($table = null, $pk = 'id', DatabaseAdapterInterface $db = null)
 {
     $this->db = $db ?: DatabaseAdapter::getInstance();
     parent::__construct($table, $pk);
 }
Beispiel #2
0
 /**
  * Constructor.
  *
  * @param string         $table       Table name.
  * @param string|array   $pk          Primary key.
  * @param DatabaseDriver $db          Database adapter.
  * @param QueryHelper    $queryHelper Query helper object.
  */
 public function __construct($table = null, $pk = 'id', DatabaseDriver $db = null, QueryHelper $queryHelper = null)
 {
     $this->db = $db ?: DatabaseFactory::getDbo();
     $this->queryHelper = $queryHelper ?: new QueryHelper($this->db);
     parent::__construct($table, $pk);
 }