/** * {@inheritdoc} */ public function getValue(ResultRecordInterface $record) { $entity = $record->getValue('entity'); $entityClass = ClassUtils::getRealClass($entity); if (!$this->mappingProvider->isClassSupported($entityClass)) { throw new InvalidConfigurationException(sprintf('Unknown entity type %s, unable to find search configuration', $entityClass)); } else { $searchTemplate = $this->mappingProvider->getMappingConfig()[$entityClass]['search_template']; } if (!$this->params->offsetGetOr('template', false)) { $this->params->offsetSet('template', $searchTemplate); } return $this->getTemplate()->render(['indexer_item' => $record->getValue('indexer_item'), 'entity' => $record->getValue('entity')]); }
public function testGetMappingConfig() { $this->assertEquals($this->testMapping, $this->provider->getMappingConfig()); }