Skip to content

Commit 55ed243

Browse files
committed
Remove internal method
1 parent 8f3bff9 commit 55ed243

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

src/TgDatabase/Criterion/QueryImpl.php

+5-21
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,7 @@ public function addOrder(Order ...$orders) {
7171
* @deprecated Use #setColumns() instead
7272
*/
7373
public function setProjection(Expression ...$components) {
74-
$this->projections = array();
75-
$this->_addColumns($components);
76-
$this->resultClassName = NULL;
77-
return $this;
74+
return call_user_func_array(array($this, 'setColumns'), $components);
7875
}
7976

8077
/**
@@ -83,30 +80,17 @@ public function setProjection(Expression ...$components) {
8380
*/
8481
public function setColumns(Expression ...$components) {
8582
$this->projections = array();
86-
$this->_addColumns($components);
87-
$this->resultClassName = NULL;
88-
return $this;
83+
return call_user_func_array(array($this, 'addColumns'), $components);
8984
}
9085

9186
/**
9287
* Add select columns for the query.
9388
*/
9489
public function addColumns(Expression ...$components) {
95-
$this->_addColumns($components);
96-
return $this;
97-
}
98-
99-
/**
100-
* Internal function to flatten array structure.
101-
*/
102-
protected function _addColumns($components) {
103-
if (is_array($components)) {
104-
foreach ($components AS $c) {
105-
$this->_addColumns($c);
106-
}
107-
} else {
108-
if ($components != NULL) $this->projections[] = $components;
90+
foreach ($components AS $c) {
91+
if ($c != NULL) $this->projections[] = $c;
10992
}
93+
return $this;
11094
}
11195

11296
/**

0 commit comments

Comments
 (0)