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