Exemplo n.º 1
0
 /**
  * Return list of columns to select from current tables;
  * @return string[]
  * @throws \Exception
  */
 protected function getAllColumnsForSelect()
 {
     $with = is_array($this->with) ? $this->with : ($this->with ? explode(',', $this->with) : array());
     if (!count($with)) {
         return ['*'];
     }
     $model = $this->model;
     $db = $model::getDb();
     $columns = $this->_columnsForModel($model::getTableName(), $db);
     foreach ($this->relationsParser->getListOfSelectedRelations() as $name => $relation) {
         $cols = $this->_columnsForRelation($relation, $db, $name);
         foreach ($cols as $column) {
             $columns[] = $column;
         }
     }
     return $columns;
 }