Neos\Flow\Property\PropertyMappingConfiguration::getTargetPropertyName PHP Метод

getTargetPropertyName() публичный Метод

Maps the given $sourcePropertyName to a target property name.
public getTargetPropertyName ( string $sourcePropertyName ) : string
$sourcePropertyName string
Результат string property name of target
    public function getTargetPropertyName($sourcePropertyName)
    {
        if (isset($this->mapping[$sourcePropertyName])) {
            return $this->mapping[$sourcePropertyName];
        }
        return $sourcePropertyName;
    }

Usage Example

 /**
  * @test
  */
 public function getTargetPropertyNameShouldRespectMapping()
 {
     $this->propertyMappingConfiguration->setMapping('k1', 'k1a');
     $this->assertEquals('k1a', $this->propertyMappingConfiguration->getTargetPropertyName('k1'));
     $this->assertEquals('k2', $this->propertyMappingConfiguration->getTargetPropertyName('k2'));
 }