1 | <?php |
||
17 | class ClassMetadata implements ClassMetadataInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $name; |
||
23 | |||
24 | /** |
||
25 | * @var PropertyMetadataInterface[] |
||
26 | */ |
||
27 | private $properties = []; |
||
28 | |||
29 | /** |
||
30 | * @var string|null |
||
31 | */ |
||
32 | private $xmlRoot; |
||
33 | |||
34 | /** |
||
35 | * @param string $name |
||
36 | */ |
||
37 | 2584 | public function __construct($name) |
|
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 2540 | public function getName() |
|
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | 2584 | public function setName($name) |
|
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 20 | public function hasProperties() |
|
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | 1804 | public function getProperties() |
|
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | 1812 | public function setProperties(array $properties) |
|
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | 1828 | public function hasProperty($name) |
|
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | 1828 | public function getProperty($name) |
|
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | 1828 | public function addProperty(PropertyMetadataInterface $property) |
|
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | 4 | public function removeProperty($name) |
|
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | 808 | public function hasXmlRoot() |
|
135 | |||
136 | /** |
||
137 | * {@inheritdoc} |
||
138 | */ |
||
139 | 644 | public function getXmlRoot() |
|
143 | |||
144 | /** |
||
145 | * {@inheritdoc} |
||
146 | */ |
||
147 | 136 | public function setXmlRoot($xmlRoot) |
|
151 | |||
152 | /** |
||
153 | * {@inheritdoc} |
||
154 | */ |
||
155 | 8 | public function merge(ClassMetadataInterface $classMetadata) |
|
156 | { |
||
157 | 8 | if ($classMetadata->hasXmlRoot()) { |
|
158 | 4 | $this->setXmlRoot($classMetadata->getXmlRoot()); |
|
159 | 2 | } |
|
160 | |||
161 | 8 | foreach ($classMetadata->getProperties() as $property) { |
|
162 | 4 | $this->addProperty($property); |
|
163 | 4 | } |
|
164 | 8 | } |
|
165 | |||
166 | /** |
||
167 | * {@inheritdoc} |
||
168 | */ |
||
169 | 4 | public function serialize() |
|
177 | |||
178 | /** |
||
179 | * {@inheritdoc} |
||
180 | */ |
||
181 | 4 | public function unserialize($serialized) |
|
189 | } |
||
190 |