1 | <?php |
||
11 | class MarathonEntityUtils |
||
12 | { |
||
13 | 37 | public static function setPropertyIfExist($source, $target, $property) |
|
22 | |||
23 | /** |
||
24 | * Sets all possible properties in the class from $data. |
||
25 | * If the type is array or object, then it is ignored if there is no conversion in $conversion_map. |
||
26 | * @param $data |
||
27 | * @param $target |
||
28 | * @param $conversionMap |
||
29 | * |
||
30 | * @return array all fields in $data that weren't stored in $target |
||
31 | */ |
||
32 | 47 | public static function setAllPossibleProperties($data, $target, $conversionMap = []) |
|
47 | |||
48 | /** |
||
49 | * This is useful if you don't want an array or object to be skipped by setAllPossibleProperties(). |
||
50 | */ |
||
51 | 21 | public static function dontConvert() { |
|
56 | |||
57 | 6 | public static function convertToArray() { |
|
62 | |||
63 | 11 | public static function convertToObject() { |
|
68 | |||
69 | /** |
||
70 | * This is usefull for shorter and stable diff output. |
||
71 | */ |
||
72 | 21 | public static function convertToSortedObject() { |
|
79 | |||
80 | 30 | public static function convertToClass($class) { |
|
85 | |||
86 | public static function convertToArrayOfClass($class) { |
||
97 | } |
||
98 |