1 | <?php |
||
21 | abstract class EntityMutator |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * @param EEM_Base $model |
||
26 | * @param integer $ID |
||
27 | * @param string $capability |
||
28 | * @return EE_Base_Class |
||
29 | * @throws OutOfBoundsException |
||
30 | * @throws UserError |
||
31 | * @since $VID:$ |
||
32 | */ |
||
33 | protected static function getEntityFromID(EEM_Base $model, $ID, $capability = 'ee_edit_events') |
||
38 | |||
39 | /** |
||
40 | * @param EEM_Base $model |
||
41 | * @param array $input |
||
42 | * @param string $capability |
||
43 | * @return EE_Base_Class |
||
44 | * @throws OutOfBoundsException |
||
45 | * @throws UserError |
||
46 | * @since $VID:$ |
||
47 | */ |
||
48 | protected static function getEntityFromInputData(EEM_Base $model, array $input, $capability = 'ee_edit_events') |
||
54 | |||
55 | |||
56 | /** |
||
57 | * @param EEM_Base $model |
||
58 | * @param string $capability |
||
59 | * @throws UserError |
||
60 | * @since $VID:$ |
||
61 | */ |
||
62 | protected static function checkPermissions(EEM_Base $model, $capability = 'ee_edit_events') |
||
80 | |||
81 | /** |
||
82 | * @param EEM_Base $model |
||
83 | * @param array $input |
||
84 | * @return int |
||
85 | * @throws OutOfBoundsException |
||
86 | * @since $VID:$ |
||
87 | */ |
||
88 | protected static function getEntityIDFromGlobalId(EEM_Base $model, array $input) |
||
108 | |||
109 | |||
110 | /** |
||
111 | * @param EEM_Base $model |
||
112 | * @param int $ID |
||
113 | * @return EE_Base_Class |
||
114 | * @throws OutOfBoundsException |
||
115 | * @since $VID:$ |
||
116 | */ |
||
117 | protected static function getEntity(EEM_Base $model, $ID = 0) |
||
137 | |||
138 | |||
139 | /** |
||
140 | * @param $results |
||
141 | * @param string $message |
||
142 | * @throws RuntimeException |
||
143 | * @since $VID:$ |
||
144 | */ |
||
145 | protected static function validateResults($results, $message = '') |
||
157 | |||
158 | |||
159 | /** |
||
160 | * @param Exception $exception |
||
161 | * @param string $message_prefix |
||
162 | * @throws RuntimeException |
||
163 | * @since $VID:$ |
||
164 | */ |
||
165 | protected static function handleExceptions(Exception $exception, $message_prefix = '') |
||
177 | } |
||
178 |