1 | <?php |
||
5 | trait ModelCloning |
||
6 | { |
||
7 | /** |
||
8 | * Method fired before the Clone action is undertaken. |
||
9 | * |
||
10 | * @return |
||
11 | */ |
||
12 | protected function beforeClone() |
||
15 | |||
16 | /** |
||
17 | * Clone Action. |
||
18 | * |
||
19 | * Fires off beforeClone(), doClone() and afterClone() |
||
20 | * |
||
21 | * @param int $modelitemId |
||
22 | * |
||
23 | * @return |
||
24 | */ |
||
25 | public function clone($modelitemId) |
||
37 | |||
38 | /** |
||
39 | * The actual Clone action, which does all of hte pre-processing |
||
40 | * required before we are able to perform the save() function. |
||
41 | * |
||
42 | * @return |
||
43 | */ |
||
44 | private function doClone() |
||
56 | |||
57 | /** |
||
58 | * Method fired after the Clone action is complete. |
||
59 | * |
||
60 | * @return |
||
61 | */ |
||
62 | protected function afterClone() |
||
65 | |||
66 | /** |
||
67 | * An Array of Fields to Exclude on Clone. |
||
68 | * |
||
69 | * When cloning a Model ceratin data might need to be skipped |
||
70 | * either because it is irrelevant (such as datestamps) or |
||
71 | * because it is primary or unique data in the database. |
||
72 | * |
||
73 | * @return array |
||
74 | */ |
||
75 | public function excludeOnClone() |
||
83 | |||
84 | /** |
||
85 | * |
||
86 | */ |
||
87 | public function unCloneableColumns() |
||
93 | } |
||
94 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.