|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace DummyNamespace; |
| 4 | + |
| 5 | +use PPSpaces\Repositories\ModelRepository; |
| 6 | + |
| 7 | +class DummyClass extends ModelRepository { |
| 8 | + |
| 9 | + /** |
| 10 | + * The model instance. |
| 11 | + * |
| 12 | + * @var string |
| 13 | + */ |
| 14 | + protected $DummyModelVariable; |
| 15 | + |
| 16 | + /** |
| 17 | + * Create a new repository instance. |
| 18 | + * |
| 19 | + * @param \Illuminate\Database\Eloquent\Model $DummyModelVariable |
| 20 | + * @return void |
| 21 | + */ |
| 22 | + public function __construct(DummyModelClass $DummyModelVariable) {} |
| 23 | + |
| 24 | + /** |
| 25 | + * Get all of the models from the database. |
| 26 | + * |
| 27 | + * @param array|mixed $columns |
| 28 | + * @return \Illuminate\Database\Eloquent\Collection|static[] |
| 29 | + */ |
| 30 | + public function all($columns = ['*']) { |
| 31 | + // return $this->get($columns); |
| 32 | + } |
| 33 | + |
| 34 | + /** |
| 35 | + * Dynamically retrieve attributes on the model. |
| 36 | + * |
| 37 | + * @param array $columns |
| 38 | + * @return \Illuminate\Database\Eloquent\Model |
| 39 | + */ |
| 40 | + public function get($columns = ['*']) { |
| 41 | + // return $this->DummyModelVariable->get($columns); |
| 42 | + } |
| 43 | + |
| 44 | + /** |
| 45 | + * Get a new query of one model by their IDs. |
| 46 | + * |
| 47 | + * @param array|int $ids |
| 48 | + * @return \Illuminate\Database\Eloquent\Model |
| 49 | + */ |
| 50 | + public function find($id) { |
| 51 | + // return $this->DummyModelVariable->findOrFail($id); |
| 52 | + } |
| 53 | + |
| 54 | + /** |
| 55 | + * Perform a model create operation. |
| 56 | + * |
| 57 | + * @param \Illuminate\Database\Eloquent\Model $query |
| 58 | + * @return bool |
| 59 | + */ |
| 60 | + public function create(array $attributes) { |
| 61 | + // return $this->DummyModelVariable->create($attributes); |
| 62 | + } |
| 63 | + |
| 64 | + /** |
| 65 | + * Update the model in the database. |
| 66 | + * |
| 67 | + * @param array $attributes |
| 68 | + * @param array $options |
| 69 | + * @return bool |
| 70 | + */ |
| 71 | + public function update(array $attributes = []) { |
| 72 | + // return $this->DummyModelVariable->update($attributes); |
| 73 | + } |
| 74 | + |
| 75 | + /** |
| 76 | + * Delete the model from the database. |
| 77 | + * |
| 78 | + * @return bool|null |
| 79 | + * |
| 80 | + * @throws \Exception |
| 81 | + */ |
| 82 | + public function delete($id) { |
| 83 | + // return $this->DummyModelVariable->findOrFail($id)->delete(); |
| 84 | + } |
| 85 | +} |
0 commit comments