@@ 167-176 (lines=10) @@ | ||
164 | * @param array $mapping |
|
165 | * @return Metadata\EntityMetadata |
|
166 | */ |
|
167 | protected function setPersistence(Metadata\EntityMetadata $metadata, array $mapping) |
|
168 | { |
|
169 | $persisterKey = isset($mapping['key']) ? $mapping['key'] : null; |
|
170 | $factory = $this->getPersistenceMetadataFactory($persisterKey); |
|
171 | ||
172 | $persistence = $factory->createInstance($mapping); |
|
173 | ||
174 | $metadata->setPersistence($persistence); |
|
175 | return $metadata; |
|
176 | } |
|
177 | ||
178 | /** |
|
179 | * Sets the entity search metadata from the metadata mapping. |
|
@@ 185-199 (lines=15) @@ | ||
182 | * @param array $mapping |
|
183 | * @return Metadata\EntityMetadata |
|
184 | */ |
|
185 | protected function setSearch(Metadata\EntityMetadata $metadata, array $mapping) |
|
186 | { |
|
187 | $clientKey = isset($mapping['key']) ? $mapping['key'] : null; |
|
188 | if (null === $clientKey) { |
|
189 | // Search is not enabled for this model. |
|
190 | return $metadata; |
|
191 | } |
|
192 | ||
193 | $factory = $this->getSearchMetadataFactory($clientKey); |
|
194 | ||
195 | $search = $factory->createInstance($mapping); |
|
196 | ||
197 | $metadata->setSearch($search); |
|
198 | return $metadata; |
|
199 | } |
|
200 | ||
201 | /** |
|
202 | * Sets the entity attribute metadata from the metadata mapping. |