@@ 25-36 (lines=12) @@ | ||
22 | * @return null|string |
|
23 | * @throws MapperException |
|
24 | */ |
|
25 | public function getObjectProperty($className, $apiProperty) |
|
26 | { |
|
27 | if ($this->factory->hasMetadataFor($className)) { |
|
28 | return null; |
|
29 | } |
|
30 | ||
31 | if (!in_array($apiProperty, $this->getApiProperties($className), true)) { |
|
32 | return null; |
|
33 | } |
|
34 | ||
35 | return $this->strategy->denormalize($apiProperty); |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @param string $className |
|
@@ 45-56 (lines=12) @@ | ||
42 | * @return null|string |
|
43 | * @throws MapperException |
|
44 | */ |
|
45 | public function getApiProperty($className, $objectProperty) |
|
46 | { |
|
47 | if ($this->factory->hasMetadataFor($className)) { |
|
48 | return null; |
|
49 | } |
|
50 | ||
51 | if (!in_array($objectProperty, $this->getObjectProperties($className), true)) { |
|
52 | return null; |
|
53 | } |
|
54 | ||
55 | return $this->strategy->normalize($objectProperty); |
|
56 | } |
|
57 | ||
58 | /** |
|
59 | * @param string $className |