상속: extends BaseSQLDataProvider
예제 #1
0
 public static function sqlDataProvider($table, $primaryCol, array $cols, array $summaryCols)
 {
     $connection = static::connection();
     $provider = new SQLDataProvider($connection, $table, $primaryCol, $summaryCols);
     foreach ($cols as $id => $column) {
         if (is_string($column)) {
             $label = $column;
             $options = [];
         } else {
             $label = $column['label'];
             $options = $column['options'];
         }
         $provider->addColumn($id, $id, $label, $options);
     }
     $provider->init();
     return $provider;
 }
예제 #2
0
 /**
  * @param $id
  * @param $primaryColumn
  * @return $this
  */
 public function setPrimaryColumnWithId($id, $primaryColumn)
 {
     $this->sqlProvider->setPrimaryColumn($id, $primaryColumn);
     return $this;
 }