1 | <?php |
||
13 | class CrudManager |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $name = 'Entry'; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $pluralized_name = 'Entries'; |
||
24 | |||
25 | /** |
||
26 | * @var null|CrudEntry |
||
27 | */ |
||
28 | protected $entry; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $route_uri_prefix = 'crud/'; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $route_name_prefix = 'crud.'; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $controller; |
||
44 | |||
45 | /** |
||
46 | * @var int |
||
47 | */ |
||
48 | protected $per_page = 25; |
||
49 | |||
50 | /** |
||
51 | * @var array |
||
52 | */ |
||
53 | protected $routes = [ |
||
54 | 'index' => [ |
||
55 | 'method' => 'GET', |
||
56 | 'uri' => 'index', |
||
57 | 'as' => 'index', |
||
58 | 'action' => 'index' |
||
59 | ], |
||
60 | 'create' => [ |
||
61 | 'method' => 'GET', |
||
62 | 'uri' => 'create', |
||
63 | 'as' => 'create', |
||
64 | 'action' => 'create' |
||
65 | ], |
||
66 | 'store' => [ |
||
67 | 'method' => 'POST', |
||
68 | 'uri' => 'store', |
||
69 | 'as' => 'store', |
||
70 | 'action' => 'store' |
||
71 | ], |
||
72 | 'edit' => [ |
||
73 | 'method' => 'GET', |
||
74 | 'uri' => 'edit/{id}', |
||
75 | 'as' => 'edit', |
||
76 | 'action' => 'edit' |
||
77 | ], |
||
78 | 'update' => [ |
||
79 | 'method' => 'PUT', |
||
80 | 'uri' => 'update/{id}', |
||
81 | 'as' => 'update', |
||
82 | 'action' => 'update' |
||
83 | ], |
||
84 | 'destroy' => [ |
||
85 | 'method' => 'GET', |
||
86 | 'uri' => 'destroy/{id}/{csrf}', |
||
87 | 'as' => 'destroy', |
||
88 | 'action' => 'destroy' |
||
89 | ], |
||
90 | ]; |
||
91 | |||
92 | /** |
||
93 | * Make staticly a new instance. |
||
94 | * |
||
95 | * @param void |
||
96 | * @return CrudManager |
||
97 | */ |
||
98 | public static function make() |
||
102 | |||
103 | /** |
||
104 | * @param void |
||
105 | * @return string |
||
106 | */ |
||
107 | public function getName() |
||
111 | |||
112 | /** |
||
113 | * @param string $name |
||
114 | * @param null|string $pluralized_name |
||
115 | * @return self |
||
116 | */ |
||
117 | public function setName($name, $pluralized_name = null) |
||
124 | |||
125 | /** |
||
126 | * @param void |
||
127 | * @return string |
||
128 | */ |
||
129 | public function getPluralizedName() |
||
133 | |||
134 | /** |
||
135 | * @param string $prefix |
||
136 | * @return self |
||
137 | */ |
||
138 | public function setUriPrefix($prefix) |
||
144 | |||
145 | /** |
||
146 | * @param void |
||
147 | * @return string |
||
148 | */ |
||
149 | public function getUriPrefix() |
||
153 | |||
154 | /** |
||
155 | * @param string $prefix |
||
156 | * @return self |
||
157 | */ |
||
158 | public function setNamePrefix($prefix) |
||
164 | |||
165 | /** |
||
166 | * @param string $prefix |
||
167 | * @return string |
||
168 | */ |
||
169 | public function getNamePrefix($prefix) |
||
173 | |||
174 | /** |
||
175 | * @param void |
||
176 | * @return string |
||
177 | */ |
||
178 | public function getController() |
||
182 | |||
183 | /** |
||
184 | * @param string $prefix |
||
185 | * @return self |
||
186 | */ |
||
187 | public function setController($prefix) |
||
193 | |||
194 | /** |
||
195 | * @param string $identifier |
||
196 | * @return string |
||
197 | * @throws InvalidRouteIdentifierException |
||
198 | */ |
||
199 | public function getActionRoute($identifier) |
||
225 | |||
226 | /** |
||
227 | * @param string $identifier |
||
228 | * @return string |
||
229 | * @throws InvalidRouteIdentifierException |
||
230 | */ |
||
231 | public function getActionMethod($identifier) |
||
241 | |||
242 | /** |
||
243 | * @param void |
||
244 | * @return self |
||
245 | */ |
||
246 | public function registerRoutes() |
||
270 | |||
271 | /** |
||
272 | * @param void |
||
273 | * @return CrudEntry|null |
||
274 | */ |
||
275 | public function getEntry() |
||
279 | |||
280 | /** |
||
281 | * @param CrudEntry $entry |
||
282 | * @return self |
||
283 | */ |
||
284 | public function setEntry(CrudEntry $entry) |
||
290 | |||
291 | /** |
||
292 | * @param int $per_page |
||
293 | * @return self |
||
294 | */ |
||
295 | public function setPerPage($per_page = 25) |
||
301 | |||
302 | /** |
||
303 | * @param void |
||
304 | * @return int |
||
305 | */ |
||
306 | public function getPerPage() |
||
310 | } |
||
311 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.