| @@ 167-176 (lines=10) @@ | ||
| 164 | * @param array $items |
|
| 165 | * @return Collection |
|
| 166 | */ |
|
| 167 | public function newCollection(array $items = []) |
|
| 168 | { |
|
| 169 | $collection = substr(get_class($this), 0, -5) . 'Collection'; |
|
| 170 | ||
| 171 | if (class_exists($collection)) { |
|
| 172 | return new $collection($items); |
|
| 173 | } |
|
| 174 | ||
| 175 | return new EloquentCollection($items); |
|
| 176 | } |
|
| 177 | ||
| 178 | /** |
|
| 179 | * Return the translatable flag. |
|
| @@ 305-314 (lines=10) @@ | ||
| 302 | * @param \Illuminate\Database\Query\Builder $query |
|
| 303 | * @return \Illuminate\Database\Eloquent\Builder |
|
| 304 | */ |
|
| 305 | public function newEloquentBuilder($query) |
|
| 306 | { |
|
| 307 | $builder = substr(get_class($this), 0, -5) . 'QueryBuilder'; |
|
| 308 | ||
| 309 | if (class_exists($builder)) { |
|
| 310 | return new $builder($query); |
|
| 311 | } |
|
| 312 | ||
| 313 | return new EloquentQueryBuilder($query); |
|
| 314 | } |
|
| 315 | ||
| 316 | /* |
|
| 317 | * Alias for getTranslation() |
|
| @@ 770-779 (lines=10) @@ | ||
| 767 | * @param array $items |
|
| 768 | * @return EntryCollection |
|
| 769 | */ |
|
| 770 | public function newCollection(array $items = []) |
|
| 771 | { |
|
| 772 | $collection = substr(get_class($this), 0, -5) . 'Collection'; |
|
| 773 | ||
| 774 | if (class_exists($collection)) { |
|
| 775 | return new $collection($items); |
|
| 776 | } |
|
| 777 | ||
| 778 | return new EntryCollection($items); |
|
| 779 | } |
|
| 780 | ||
| 781 | /** |
|
| 782 | * Return the entry presenter. |
|