@@ 151-160 (lines=10) @@ | ||
148 | * @param array $mapping |
|
149 | * @return Metadata\EntityMetadata |
|
150 | */ |
|
151 | protected function setPersistence(Metadata\EntityMetadata $metadata, array $mapping) |
|
152 | { |
|
153 | $persisterKey = isset($mapping['key']) ? $mapping['key'] : null; |
|
154 | $factory = $this->getPersistenceMetadataFactory($persisterKey); |
|
155 | ||
156 | $persistence = $factory->createInstance($mapping); |
|
157 | ||
158 | $metadata->setPersistence($persistence); |
|
159 | return $metadata; |
|
160 | } |
|
161 | ||
162 | /** |
|
163 | * Sets the entity search metadata from the metadata mapping. |
|
@@ 169-183 (lines=15) @@ | ||
166 | * @param array $mapping |
|
167 | * @return Metadata\EntityMetadata |
|
168 | */ |
|
169 | protected function setSearch(Metadata\EntityMetadata $metadata, array $mapping) |
|
170 | { |
|
171 | $clientKey = isset($mapping['key']) ? $mapping['key'] : null; |
|
172 | if (null === $clientKey) { |
|
173 | // Search is not enabled for this model. |
|
174 | return $metadata; |
|
175 | } |
|
176 | ||
177 | $factory = $this->getSearchMetadataFactory($clientKey); |
|
178 | ||
179 | $search = $factory->createInstance($mapping); |
|
180 | ||
181 | $metadata->setSearch($search); |
|
182 | return $metadata; |
|
183 | } |
|
184 | ||
185 | /** |
|
186 | * Sets the entity attribute metadata from the metadata mapping. |