1 | <?php |
||
14 | class Papper |
||
|
|||
15 | { |
||
16 | /** |
||
17 | * Creates a TypeMap for the source's type and destination's type. |
||
18 | * |
||
19 | * @param string $sourceType Source type |
||
20 | * @param string $destinationType Destination type |
||
21 | * @return MappingFluentSyntax |
||
22 | */ |
||
23 | public static function createMap($sourceType, $destinationType) |
||
27 | |||
28 | /** |
||
29 | * Configure mapping |
||
30 | * |
||
31 | * @param MappingConfigurationInterface $configuration |
||
32 | */ |
||
33 | public static function configureMapping(MappingConfigurationInterface $configuration) |
||
37 | |||
38 | /** |
||
39 | * Initialize a mapping from the source object. |
||
40 | * The source type can be is inferred from the source object. |
||
41 | * |
||
42 | * @param object|object[] $source Source object or collection to map from |
||
43 | * @param string|null $sourceType Source object type |
||
44 | * @throws MappingException |
||
45 | * @return ExecuteMappingFluentSyntax |
||
46 | */ |
||
47 | public static function map($source, $sourceType = null) |
||
51 | |||
52 | /** |
||
53 | * Returns mapping options |
||
54 | * |
||
55 | * @return MappingOptionsInterface |
||
56 | */ |
||
57 | public static function mappingOptions() |
||
61 | |||
62 | /** |
||
63 | * Validates that every top level destination property is mapped to source property. |
||
64 | * If not, a ValidationException is thrown detailing any missing mappings. |
||
65 | * |
||
66 | * @throws ValidationException if any TypeMaps contain unmapped properties |
||
67 | */ |
||
68 | public static function validate() |
||
72 | |||
73 | /** |
||
74 | * Clear out all existing configuration |
||
75 | */ |
||
76 | public static function reset() |
||
80 | |||
81 | /** |
||
82 | * Returns engine singleton instance |
||
83 | * |
||
84 | * @return Engine |
||
85 | */ |
||
86 | public static function engine() |
||
91 | |||
92 | //<editor-fold desc="Singleton/Static"> |
||
93 | private function __construct() |
||
96 | |||
97 | private function __clone() |
||
100 | |||
101 | /** @noinspection PhpUnusedPrivateMethodInspection */ |
||
102 | private function __wakeup() |
||
105 | //</editor-fold> |
||
106 | } |
||
107 |