@@ 95-102 (lines=8) @@ | ||
92 | * @param mixed $return External variable to store query results |
|
93 | * @return mixed If no arguments passed returns query results collection, otherwise query success status |
|
94 | */ |
|
95 | public function exec(&$return = null) |
|
96 | { |
|
97 | /** @var RecordInterface[] $return Perform DB request */ |
|
98 | $return = $this->execute('find', $this->class_name, $this); |
|
99 | ||
100 | // Return bool or collection |
|
101 | return func_num_args() ? sizeof($return) : $return; |
|
102 | } |
|
103 | ||
104 | /** |
|
105 | * Perform database request and get first record from results collection. |
|
@@ 132-139 (lines=8) @@ | ||
129 | * @return mixed If no arguments passed returns query results first database record object, |
|
130 | * otherwise query success status |
|
131 | */ |
|
132 | public function fields($fieldName, &$return = null) |
|
133 | { |
|
134 | /** @var RecordInterface[] $return Perform DB request */ |
|
135 | $return = $this->execute('fetchColumn', $this->class_name, $this, $fieldName); |
|
136 | ||
137 | // Return bool or collection |
|
138 | return func_num_args() > 1 ? sizeof($return) : $return; |
|
139 | } |
|
140 | ||
141 | /** |
|
142 | * Set query entity to work with. |