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 = ['*']) |
||
75 | |||
76 | /** |
||
77 | * Return if a table has been joined or not. |
||
78 | * |
||
79 | * @param $table |
||
80 | * @return bool |
||
81 | */ |
||
82 | public function hasJoin($table) |
||
97 | |||
98 | /** |
||
99 | * Remember and index. |
||
100 | * |
||
101 | * @return $this |
||
102 | */ |
||
103 | protected function rememberIndex() |
||
111 | |||
112 | /** |
||
113 | * Index cache collection |
||
114 | * |
||
115 | * @return object |
||
116 | */ |
||
117 | protected function indexCacheCollection() |
||
126 | |||
127 | /** |
||
128 | * Drop a cache collection |
||
129 | * from runtime cache. |
||
130 | * |
||
131 | * @param $collection |
||
132 | */ |
||
133 | public static function dropRuntimeCache($collection) |
||
137 | |||
138 | /** |
||
139 | * Get the unique cache key for the query. |
||
140 | * |
||
141 | * @return string |
||
142 | */ |
||
143 | public function getCacheKey() |
||
149 | |||
150 | /** |
||
151 | * Set the model TTl. |
||
152 | * |
||
153 | * @param $ttl |
||
154 | * @return $this |
||
155 | */ |
||
156 | public function cache($ttl) |
||
162 | |||
163 | /** |
||
164 | * Get fresh models / disable cache |
||
165 | * |
||
166 | * @param boolean $fresh |
||
167 | * @return object |
||
168 | */ |
||
169 | public function fresh($fresh = true) |
||
177 | |||
178 | /** |
||
179 | * Update a record in the database. |
||
180 | * |
||
181 | * @param array $values |
||
182 | * @return int |
||
183 | */ |
||
184 | public function update(array $values) |
||
194 | |||
195 | /** |
||
196 | * Delete a record from the database. |
||
197 | * |
||
198 | * @return mixed |
||
199 | */ |
||
200 | public function delete() |
||
210 | |||
211 | /** |
||
212 | * Order by sort_order if null. |
||
213 | */ |
||
214 | protected function orderByDefault() |
||
260 | } |
||
261 |