Neos\Flow\ObjectManagement\DependencyInjection\ProxyClassBuilder::buildPropertyInjectionCodeByConfigurationTypeAndPath PHP Метод

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

Builds code which assigns the value stored in the specified configuration into the given class property.
public buildPropertyInjectionCodeByConfigurationTypeAndPath ( Configuration $objectConfiguration, string $propertyName, string $configurationType, string $configurationPath = null ) : array
$objectConfiguration Neos\Flow\ObjectManagement\Configuration\Configuration Configuration of the object to inject into
$propertyName string Name of the property to inject
$configurationType string the configuration type of the injected property (one of the ConfigurationManager::CONFIGURATION_TYPE_* constants)
$configurationPath string Path with "." as separator specifying the setting value to inject or NULL if the complete configuration array should be injected
Результат array PHP code
    public function buildPropertyInjectionCodeByConfigurationTypeAndPath(Configuration $objectConfiguration, $propertyName, $configurationType, $configurationPath = null)
    {
        $className = $objectConfiguration->getClassName();
        if ($configurationPath !== null) {
            $preparedSetterArgument = '\\Neos\\Flow\\Core\\Bootstrap::$staticObjectManager->get(\\Neos\\Flow\\Configuration\\ConfigurationManager::class)->getConfiguration(\'' . $configurationType . '\', \'' . $configurationPath . '\')';
        } else {
            $preparedSetterArgument = '\\Neos\\Flow\\Core\\Bootstrap::$staticObjectManager->get(\\Neos\\Flow\\Configuration\\ConfigurationManager::class)->getConfiguration(\'' . $configurationType . '\')';
        }
        $result = $this->buildSetterInjectionCode($className, $propertyName, $preparedSetterArgument);
        if ($result !== null) {
            return $result;
        }
        return ['    $this->' . $propertyName . ' = ' . $preparedSetterArgument . ';'];
    }