コード例 #1
0
 public function __construct($table, AdapterInterface $adapter, $features = null)
 {
     $features = is_array($features) ? $features : ($features ? array($features) : []);
     if (!$this->primaryKeyField) {
         $this->primaryKeyField = $table . '_id';
     }
     // Фича для постгреса - дает возможность пользоваться методом getLastInsertValue().
     $primaryKeySequenceName = $table . '_' . $this->primaryKeyField . '_seq';
     $features[] = new SequenceFeature($this->primaryKeyField, $primaryKeySequenceName);
     // Фича для использования RowGateway при выборках.
     $features[] = new RowGatewayFeature($this->primaryKeyField);
     parent::__construct($table, $adapter, $features);
 }
コード例 #2
0
 public function __construct($table, $primaryKeyField, AdapterInterface $adapter, $features = null)
 {
     $this->primaryKeyField = $primaryKeyField;
     parent::__construct($table, $adapter, $features);
 }