Sulu\Component\Content\Extension\AbstractExtension::getFieldMapping PHP Method

getFieldMapping() public method

public getFieldMapping ( )
    public function getFieldMapping()
    {
        return [];
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function getFieldMapping()
 {
     $mappings = parent::getFieldMapping();
     foreach ($this->getExcerptStructure()->getPropertiesByTagName('sulu.search.field') as $property) {
         $tag = $property->getTag('sulu.search.field');
         $tagAttributes = $tag->getAttributes();
         $mappings['excerpt' . ucfirst($property->getName())] = ['type' => isset($tagAttributes['type']) ? $tagAttributes['type'] : 'string', 'field' => $this->factory->createMetadataExpression(sprintf('object.getExtensionsData()["excerpt"]["%s"]', $property->getName()))];
     }
     return $mappings;
 }