1 | <?php namespace Modules\Blog\Repositories\Eloquent; |
||
13 | class EloquentPostRepository extends EloquentBaseRepository implements PostRepository |
||
14 | { |
||
15 | /** |
||
16 | * @param int $id |
||
17 | * @return object |
||
18 | */ |
||
19 | public function find($id) |
||
23 | |||
24 | /** |
||
25 | * @return \Illuminate\Database\Eloquent\Collection |
||
26 | */ |
||
27 | public function all() |
||
31 | |||
32 | /** |
||
33 | * Update a resource |
||
34 | * @param $post |
||
35 | * @param array $data |
||
36 | * @return mixed |
||
37 | */ |
||
38 | public function update($post, $data) |
||
48 | |||
49 | /** |
||
50 | * Create a blog post |
||
51 | * @param array $data |
||
52 | * @return Post |
||
53 | */ |
||
54 | public function create($data) |
||
64 | |||
65 | public function destroy($model) |
||
71 | |||
72 | /** |
||
73 | * Return all resources in the given language |
||
74 | * |
||
75 | * @param string $lang |
||
76 | * @return \Illuminate\Database\Eloquent\Collection |
||
77 | */ |
||
78 | public function allTranslatedIn($lang) |
||
85 | |||
86 | /** |
||
87 | * Return the latest x blog posts |
||
88 | * @param int $amount |
||
89 | * @return Collection |
||
90 | */ |
||
91 | public function latest($amount = 5) |
||
95 | |||
96 | /** |
||
97 | * Get the previous post of the given post |
||
98 | * @param object $post |
||
99 | * @return object |
||
100 | */ |
||
101 | public function getPreviousOf($post) |
||
106 | |||
107 | /** |
||
108 | * Get the next post of the given post |
||
109 | * @param object $post |
||
110 | * @return object |
||
111 | */ |
||
112 | public function getNextOf($post) |
||
117 | |||
118 | /** |
||
119 | * Find a resource by the given slug |
||
120 | * |
||
121 | * @param string $slug |
||
122 | * @return object |
||
123 | */ |
||
124 | public function findBySlug($slug) |
||
130 | } |
||
131 |