1 | <?php |
||
8 | final class AssociationPropertyAccessor implements PropertyAccessorInterface |
||
9 | { |
||
10 | /** @var PropertyAccessorInterface */ |
||
11 | private $delegate; |
||
12 | /** @var AssociationNormalizer */ |
||
13 | private $normalizer; |
||
14 | |||
15 | /** |
||
16 | * AssociationPropertyAccessor constructor. |
||
17 | * |
||
18 | * @param PropertyAccessorInterface $delegate |
||
19 | * @param ManagerRegistry $registry |
||
20 | */ |
||
21 | 13 | public function __construct(PropertyAccessorInterface $delegate, ManagerRegistry $registry) |
|
22 | { |
||
23 | 13 | $this->delegate = $delegate; |
|
24 | 13 | $this->normalizer = new AssociationNormalizer($registry); |
|
25 | 13 | } |
|
26 | |||
27 | /** {@inheritdoc} */ |
||
28 | public function setValue(&$objectOrArray, $propertyPath, $value) |
||
34 | |||
35 | /** {@inheritdoc} */ |
||
36 | 8 | public function getValue($objectOrArray, $propertyPath) |
|
37 | { |
||
38 | 8 | return $this->normalizer->normalize( |
|
39 | 8 | $this->delegate->getValue($objectOrArray, $propertyPath), |
|
40 | 8 | $objectOrArray, |
|
41 | 8 | $propertyPath |
|
42 | ); |
||
43 | } |
||
44 | |||
45 | /** {@inheritdoc} */ |
||
46 | public function isWritable($objectOrArray, $propertyPath) |
||
50 | |||
51 | /** {@inheritdoc} */ |
||
52 | public function isReadable($objectOrArray, $propertyPath) |
||
56 | } |
||
57 |