From f99f3332189f24d524e396fa3199f4420f6427e4 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 15 Apr 2015 10:03:17 +0200 Subject: [PATCH] added note to docs about #8085 --- framework/db/Query.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/framework/db/Query.php b/framework/db/Query.php index d55dbc47a6..682e50671e 100644 --- a/framework/db/Query.php +++ b/framework/db/Query.php @@ -428,6 +428,14 @@ class Query extends Component implements QueryInterface /** * Add more columns to the SELECT part of the query. + * + * Note, that if [[select]] has not been specified before, you should include `*` explicitly + * if you want to select all remaining columns too: + * + * ```php + * $query->addSelect(["*", "CONCAT(first_name, ' ', last_name) AS full_name"])->one(); + * ``` + * * @param string|array $columns the columns to add to the select. * @return static the query object itself * @see select()