1 | <?php namespace Anomaly\Streams\Platform\Model; |
||
17 | class EloquentQueryBuilder extends Builder |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * Runtime cache. |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | protected static $cache = []; |
||
26 | |||
27 | /** |
||
28 | * The model being queried. |
||
29 | * |
||
30 | * @var EloquentModel |
||
31 | */ |
||
32 | protected $model; |
||
33 | |||
34 | /** |
||
35 | * Execute the query as a "select" statement. |
||
36 | * |
||
37 | * @param array $columns |
||
38 | * @return \Illuminate\Database\Eloquent\Collection|static[] |
||
39 | */ |
||
40 | public function get($columns = ['*']) |
||
74 | |||
75 | /** |
||
76 | * Return if a table has been joined or not. |
||
77 | * |
||
78 | * @param $table |
||
79 | * @return bool |
||
80 | */ |
||
81 | public function hasJoin($table) |
||
96 | |||
97 | /** |
||
98 | * Remember and index. |
||
99 | * |
||
100 | * @return $this |
||
101 | */ |
||
102 | protected function rememberIndex() |
||
110 | |||
111 | /** |
||
112 | * Index cache collection |
||
113 | * |
||
114 | * @return object |
||
115 | */ |
||
116 | protected function indexCacheCollection() |
||
125 | |||
126 | /** |
||
127 | * Drop a cache collection |
||
128 | * from runtime cache. |
||
129 | * |
||
130 | * @param $collection |
||
131 | */ |
||
132 | public static function dropRuntimeCache($collection) |
||
136 | |||
137 | /** |
||
138 | * Get the unique cache key for the query. |
||
139 | * |
||
140 | * @return string |
||
141 | */ |
||
142 | public function getCacheKey() |
||
148 | |||
149 | /** |
||
150 | * Set the model TTl. |
||
151 | * |
||
152 | * @param $ttl |
||
153 | * @return $this |
||
154 | */ |
||
155 | public function cache($ttl) |
||
161 | |||
162 | /** |
||
163 | * Get fresh models / disable cache |
||
164 | * |
||
165 | * @param boolean $fresh |
||
166 | * @return object |
||
167 | */ |
||
168 | public function fresh($fresh = true) |
||
176 | |||
177 | /** |
||
178 | * Update a record in the database. |
||
179 | * |
||
180 | * @param array $values |
||
181 | * @return int |
||
182 | */ |
||
183 | public function update(array $values) |
||
193 | |||
194 | /** |
||
195 | * Delete a record from the database. |
||
196 | * |
||
197 | * @return mixed |
||
198 | */ |
||
199 | public function delete() |
||
209 | |||
210 | /** |
||
211 | * Order by sort_order if null. |
||
212 | */ |
||
213 | protected function orderByDefault() |
||
254 | } |
||
255 |