src/Sulu/Component/DocumentManager/Metadata.php
public function addFieldMapping($name, $mapping)
    {
        $mapping = array_merge([
            'encoding' => 'content',
            'property' => $name,
            'type' => null,
            'mapped' => true,
            'multiple' => false,
            'default' => null,
        ], $mapping);

        $this->fieldMappings[$name] = $mapping;
    }
public function addFieldMapping($name, $mapping)
    {
        $mapping = array_merge([
            'encoding' => 'content',
            'property' => $name,
            'type' => null,
            'mapped' => true,
            'multiple' => false,
            'default' => null,
        ], $mapping);

        $this->fieldMappings[$name] = $mapping;
    }
public function addFieldMapping ( $ name , $ mapping ) { $ mapping = array_merge ( [ 'encoding' => 'content' , 'property' => $ name , 'type' => null , 'mapped' => true , 'multiple' => false , 'default' => null , ] , $ mapping ) ; $ this -> fieldMappings [ $ name ] = $ mapping ; }
Add a field mapping for field with given name, for example.

````
$metadata->addFieldMapping(array(
'encoding' => 'content',
'property' => 'phpcr_property_name',
));
````

@param string $name Name of field/property in the mapped class
@param array $mapping {

@var string Encoding type to use, @see \Sulu\Component\DocumentManager\PropertyEncoder::encode()
@var string PHPCR property name (excluding the prefix)
@var string Type of field (leave blank to determine automatically)
@var bool If the field should be mapped. Set to false to manually persist and hydrate the data.
}
Add a field mapping for field with given name for example .