[2.0][DDC-249] Fixed issue that documentation refers QueryBuilder::select() supports array, but it was only restricted to strings.
This commit is contained in:
parent
2ff76e44c0
commit
8c3ba7dbf0
1 changed files with 9 additions and 7 deletions
|
@ -401,12 +401,13 @@ class QueryBuilder
|
|||
public function select($select = null)
|
||||
{
|
||||
$this->_type = self::SELECT;
|
||||
$selects = func_get_args();
|
||||
|
||||
if (empty($selects)) {
|
||||
|
||||
if (empty($select)) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
$selects = is_array($select) ? $select : func_get_args();
|
||||
|
||||
return $this->add('select', new Expr\Select($selects), false);
|
||||
}
|
||||
|
||||
|
@ -426,11 +427,12 @@ class QueryBuilder
|
|||
public function addSelect($select = null)
|
||||
{
|
||||
$this->_type = self::SELECT;
|
||||
$selects = func_get_args();
|
||||
|
||||
if (empty($selects)) {
|
||||
return $this;
|
||||
|
||||
if (empty($select)) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
$selects = is_array($select) ? $select : func_get_args();
|
||||
|
||||
return $this->add('select', new Expr\Select($selects), true);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue