1 | <?php |
||
39 | class Query extends \ArrayObject |
||
40 | { |
||
41 | const TYPE_SELECT = 'select'; |
||
42 | const TYPE_DELETE = 'delete'; |
||
43 | const TYPE_INSERT = 'insert'; |
||
44 | const TYPE_UPDATE = 'update'; |
||
45 | |||
46 | const JOIN_INNER = 'inner'; |
||
47 | const JOIN_LEFT = 'left'; |
||
48 | |||
49 | const WHERE_AND = 'and'; |
||
50 | const WHERE_OR = 'or'; |
||
51 | |||
52 | const FETCH_SPECIAL = 0; |
||
53 | const FETCH_OPT = 1; |
||
54 | |||
55 | protected $fetchMode = self::FETCH_SPECIAL; |
||
56 | |||
57 | /** |
||
58 | * |
||
59 | * @var string |
||
60 | */ |
||
61 | protected $type; |
||
62 | |||
63 | protected $options; |
||
64 | |||
65 | /** |
||
66 | * |
||
67 | * @param array $options |
||
68 | * |
||
69 | * @return void |
||
|
|||
70 | */ |
||
71 | public function __construct(array $options = array()) |
||
76 | |||
77 | /** |
||
78 | * |
||
79 | * @param mixed $columns |
||
80 | * |
||
81 | * @return Query |
||
82 | */ |
||
83 | public function select($columns = null) |
||
90 | |||
91 | public function from($table, $alias = null) |
||
101 | |||
102 | public function setFetchMode($mode) |
||
108 | |||
109 | public function getFetchMode() |
||
114 | |||
115 | /** |
||
116 | * |
||
117 | * @param mixed $table |
||
118 | * |
||
119 | * @return Query |
||
120 | */ |
||
121 | public function delete($table) |
||
128 | |||
129 | /** |
||
130 | * |
||
131 | * @param mixed $table |
||
132 | * |
||
133 | * @return Query |
||
134 | */ |
||
135 | public function insert($table) |
||
142 | |||
143 | /** |
||
144 | * |
||
145 | * @param mixed $table |
||
146 | * |
||
147 | * @return Query |
||
148 | */ |
||
149 | public function update($table) |
||
156 | |||
157 | /** |
||
158 | * |
||
159 | * @param string $condition |
||
160 | * @return Query |
||
161 | */ |
||
162 | public function where($condition) |
||
168 | |||
169 | /** |
||
170 | * |
||
171 | * @param string $condition |
||
172 | * |
||
173 | * @return Query |
||
174 | */ |
||
175 | public function andWhere($condition) |
||
186 | |||
187 | /** |
||
188 | * |
||
189 | * @param string $condition |
||
190 | * |
||
191 | * @return Query |
||
192 | */ |
||
193 | public function orWhere($condition) |
||
204 | |||
205 | /** |
||
206 | * |
||
207 | * @param mixed $limit |
||
208 | * |
||
209 | * @return Query |
||
210 | */ |
||
211 | public function limit($max, $offset = null) |
||
217 | |||
218 | /** |
||
219 | * |
||
220 | * @param string $group |
||
221 | * |
||
222 | * @return Query |
||
223 | */ |
||
224 | public function groupBy($group) |
||
230 | |||
231 | public function orderBy($column, $order = null) |
||
237 | |||
238 | /** |
||
239 | * |
||
240 | * @return Query |
||
241 | */ |
||
242 | public static function factory() |
||
246 | |||
247 | public function set($key, $value) |
||
255 | |||
256 | public function values(array $values) |
||
263 | |||
264 | public function join($table, $localColumn, $foreignColumn = null, $type = Query::JOIN_LEFT, $options = array()) |
||
298 | |||
299 | public function getType() |
||
303 | |||
304 | /** |
||
305 | * |
||
306 | * |
||
307 | * @param string $entityClass |
||
308 | * @return Query |
||
309 | */ |
||
310 | public function entity($entityClass, array $listeners = array()) |
||
317 | |||
318 | /** |
||
319 | * Prevent 'undefined index' errors |
||
320 | * |
||
321 | * @param string $key |
||
322 | * @return mixed |
||
323 | */ |
||
324 | public function offsetGet($key) |
||
332 | } |
||
333 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.