1 | <?php |
||
14 | class EloquentBlockRepository extends EloquentBaseRepository implements BlockRepository |
||
15 | { |
||
16 | /** |
||
17 | * @param mixed $data |
||
18 | * @return mixed |
||
19 | */ |
||
20 | public function create($data) |
||
32 | |||
33 | /** |
||
34 | * @param $model |
||
35 | * @param array $data |
||
36 | * @return object |
||
37 | */ |
||
38 | public function update($model, $data) |
||
52 | |||
53 | /** |
||
54 | * Get all online blocks in the given language |
||
55 | * @param string $lang |
||
56 | * @return object |
||
57 | */ |
||
58 | public function allOnlineInLang($lang) |
||
65 | |||
66 | /** |
||
67 | * Get a block body by its name if it's online |
||
68 | * @param string $name |
||
69 | * @return string |
||
70 | */ |
||
71 | public function get($name) |
||
82 | |||
83 | /** |
||
84 | * Get the current application locale |
||
85 | * @return string |
||
86 | */ |
||
87 | private function getCurrentLocale() |
||
91 | |||
92 | /** |
||
93 | * Normalize the request data |
||
94 | * @param array $data |
||
95 | */ |
||
96 | private function sluggify(array &$data) |
||
100 | |||
101 | /** |
||
102 | * Make the name unique by appending a counter |
||
103 | * @param string $slug |
||
104 | * @return string |
||
105 | */ |
||
106 | private function makeNameUnique($slug) |
||
129 | |||
130 | /** |
||
131 | * Get the existing models matching the given slug |
||
132 | * @param string $slug |
||
133 | * @return array |
||
134 | */ |
||
135 | private function getExistingSlugs($slug) |
||
143 | |||
144 | /** |
||
145 | * Check if given array is empty |
||
146 | * @param array $list |
||
147 | * @return bool |
||
148 | */ |
||
149 | private function isEmptyArray(array $list) |
||
153 | |||
154 | /** |
||
155 | * Check if the given slug is present in the given array |
||
156 | * @param string $slug |
||
157 | * @param array $list |
||
158 | * @return bool |
||
159 | */ |
||
160 | private function isSlugInList($slug, array $list) |
||
164 | |||
165 | /** |
||
166 | * Check if we have our model |
||
167 | * @param $list |
||
168 | * @return bool |
||
169 | */ |
||
170 | private function isForModel($list) |
||
174 | |||
175 | /** |
||
176 | * Check if the given slug is in the given list |
||
177 | * @param string $slug |
||
178 | * @param array $list |
||
179 | * @return bool |
||
180 | */ |
||
181 | private function slugIsInList($slug, array $list) |
||
185 | |||
186 | /** |
||
187 | * @return mixed |
||
188 | */ |
||
189 | private function findHighestIncrement($list) |
||
196 | |||
197 | /** |
||
198 | * Check if the given model needs to be slugged |
||
199 | * @param object $model |
||
200 | * @param array $data |
||
201 | * @return bool |
||
202 | */ |
||
203 | private function needsSlugging($model, array $data) |
||
207 | } |
||
208 |