/** * @param $table * * @return array */ private function getFields($table) { $fields = $this->entity->getFieldNames(); if (empty($this->with) && $this->alias === null) { return $fields; } $table = $this->getTableAlias($table); $prefixIfMissing = function ($field) use($table) { if (strpos($field, '.') !== false) { return $field; } return $table . '.' . $field; }; return array_map($prefixIfMissing, $fields); }