1 | <?php |
||
29 | class InstantiatorSubscriber implements EventSubscriberInterface |
||
30 | { |
||
31 | /** |
||
32 | * @var MetadataFactoryInterface |
||
33 | */ |
||
34 | private $metadataFactory; |
||
35 | |||
36 | /** |
||
37 | * @param MetadataFactoryInterface $metadataFactory |
||
38 | */ |
||
39 | public function __construct( |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public static function getSubscribedEvents() |
||
55 | |||
56 | /** |
||
57 | * @param HydrateEvent $event |
||
58 | */ |
||
59 | public function handleHydrate(HydrateEvent $event) |
||
71 | |||
72 | /** |
||
73 | * @param mixed $event |
||
74 | */ |
||
75 | public function handleCreate(CreateEvent $event) |
||
81 | |||
82 | /** |
||
83 | * Instantiate a new document. The class is determined from |
||
84 | * the mixins present in the PHPCR node for legacy reasons. |
||
85 | * |
||
86 | * @param NodeInterface $node |
||
87 | * |
||
88 | * @return object |
||
89 | */ |
||
90 | private function getDocumentFromNode(NodeInterface $node) |
||
96 | |||
97 | /** |
||
98 | * @param Metadata $metadata |
||
99 | * |
||
100 | * @return object |
||
101 | */ |
||
102 | private function instantiateFromMetadata(Metadata $metadata) |
||
116 | } |
||
117 |