1 | <?php |
||
25 | class EntityToIdObjectTransformer implements DataTransformerInterface |
||
26 | { |
||
27 | private $om; |
||
28 | private $entityName; |
||
29 | |||
30 | public function __construct(ObjectManager $om, string $entityName) |
||
31 | { |
||
32 | $this->entityName = $entityName; |
||
33 | $this->om = $om; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Do nothing. |
||
38 | * |
||
39 | * @param object|null $object |
||
40 | */ |
||
41 | public function transform($object): string |
||
49 | |||
50 | /** |
||
51 | * Transforms an array including an identifier to an object. |
||
52 | * |
||
53 | * @param array $idObject |
||
54 | * |
||
55 | * @throws TransformationFailedException if object is not found |
||
56 | */ |
||
57 | public function reverseTransform($idObject): ?object |
||
76 | } |
||
77 |