/** * @param Select $select * @param Where $where * @param OrderBy $orderBy * @return Column[] */ private function getAllColumns(Select $select, Where $where, OrderBy $orderBy) : array { $columns = []; foreach ($select->getColumns() as $column) { $columns[$column->getFullName()] = $column; } $whereColumns = $this->getAllColumnsFromWhere($where->getConditions()); foreach ($whereColumns as $column) { $columns[$column->getFullName()] = $column; } foreach ($orderBy->getColumns() as $column) { $columns[$column->getFullName()] = $column; } return $columns; }