protected function buildPropertyInjectionCodeByConfiguration(Configuration $objectConfiguration, $propertyName, Configuration $propertyConfiguration)
    {
        $className = $objectConfiguration->getClassName();
        $propertyObjectName = $propertyConfiguration->getObjectName();
        $propertyClassName = $propertyConfiguration->getClassName();
        if ($propertyClassName === null) {
            $preparedSetterArgument = $this->buildCustomFactoryCall($propertyConfiguration->getFactoryObjectName(), $propertyConfiguration->getFactoryMethodName(), $propertyConfiguration->getArguments());
        } else {
            if (!is_string($propertyClassName) || !isset($this->objectConfigurations[$propertyClassName])) {
                $configurationSource = $objectConfiguration->getConfigurationSourceHint();
                throw new ObjectException\UnknownObjectException('Unknown class "' . $propertyClassName . '", specified as property "' . $propertyName . '" in the object configuration of object "' . $objectConfiguration->getObjectName() . '" (' . $configurationSource . ').', 1296130876);
            }
            if ($this->objectConfigurations[$propertyClassName]->getScope() === Configuration::SCOPE_PROTOTYPE) {
                $preparedSetterArgument = 'new \\' . $propertyClassName . '(' . $this->buildMethodParametersCode($propertyConfiguration->getArguments()) . ')';
            } else {
                $preparedSetterArgument = '\Neos\Flow\Core\Bootstrap::$staticObjectManager->get(\'' . $propertyClassName . '\')';
            }
        }

        $result = $this->buildSetterInjectionCode($className, $propertyName, $preparedSetterArgument);
        if ($result !== null) {
            return $result;
        }

        return $this->buildLazyPropertyInjectionCode($propertyObjectName, $propertyClassName, $propertyName, $preparedSetterArgument);
    }
protected function buildPropertyInjectionCodeByConfiguration(Configuration $objectConfiguration, $propertyName, Configuration $propertyConfiguration)
    {
        $className = $objectConfiguration->getClassName();
        $propertyObjectName = $propertyConfiguration->getObjectName();
        $propertyClassName = $propertyConfiguration->getClassName();
        if ($propertyClassName === null) {
            $preparedSetterArgument = $this->buildCustomFactoryCall($propertyConfiguration->getFactoryObjectName(), $propertyConfiguration->getFactoryMethodName(), $propertyConfiguration->getArguments());
        } else {
            if (!is_string($propertyClassName) || !isset($this->objectConfigurations[$propertyClassName])) {
                $configurationSource = $objectConfiguration->getConfigurationSourceHint();
                throw new ObjectException\UnknownObjectException('Unknown class "' . $propertyClassName . '", specified as property "' . $propertyName . '" in the object configuration of object "' . $objectConfiguration->getObjectName() . '" (' . $configurationSource . ').', 1296130876);
            }
            if ($this->objectConfigurations[$propertyClassName]->getScope() === Configuration::SCOPE_PROTOTYPE) {
                $preparedSetterArgument = 'new \\' . $propertyClassName . '(' . $this->buildMethodParametersCode($propertyConfiguration->getArguments()) . ')';
            } else {
                $preparedSetterArgument = '\Neos\Flow\Core\Bootstrap::$staticObjectManager->get(\'' . $propertyClassName . '\')';
            }
        }

        $result = $this->buildSetterInjectionCode($className, $propertyName, $preparedSetterArgument);
        if ($result !== null) {
            return $result;
        }

        return $this->buildLazyPropertyInjectionCode($propertyObjectName, $propertyClassName, $propertyName, $preparedSetterArgument);
    }
protected function buildPropertyInjectionCodeByConfiguration ( Configuration $ objectConfiguration , $ propertyName , Configuration $ propertyConfiguration ) { $ className = $ objectConfiguration -> getClassName ( ) ; $ propertyObjectName = $ propertyConfiguration -> getObjectName ( ) ; $ propertyClassName = $ propertyConfiguration -> getClassName ( ) ; if ( $ propertyClassName === null ) { $ preparedSetterArgument = $ this -> buildCustomFactoryCall ( $ propertyConfiguration -> getFactoryObjectName ( ) , $ propertyConfiguration -> getFactoryMethodName ( ) , $ propertyConfiguration -> getArguments ( ) ) ; } else { if ( ! is_string ( $ propertyClassName ) || ! isset ( $ this -> objectConfigurations [ $ propertyClassName ] ) ) { $ configurationSource = $ objectConfiguration -> getConfigurationSourceHint ( ) ; throw new ObjectException \ UnknownObjectException ( 'Unknown class "' . $ propertyClassName . '", specified as property "' . $ propertyName . '" in the object configuration of object "' . $ objectConfiguration -> getObjectName ( ) . '" (' . $ configurationSource . ').' , 1296130876 ) ; } if ( $ this -> objectConfigurations [ $ propertyClassName ] -> getScope ( ) === Configuration :: SCOPE_PROTOTYPE ) { $ preparedSetterArgument = 'new \\' . $ propertyClassName . '(' . $ this -> buildMethodParametersCode ( $ propertyConfiguration -> getArguments ( ) ) . ')' ; } else { $ preparedSetterArgument = '\Neos\Flow\Core\Bootstrap::$staticObjectManager->get(\'' . $ propertyClassName . '\')' ; } } $ result = $ this -> buildSetterInjectionCode ( $ className , $ propertyName , $ preparedSetterArgument ) ; if ( $ result !== null ) { return $ result ; } return $ this -> buildLazyPropertyInjectionCode ( $ propertyObjectName , $ propertyClassName , $ propertyName , $ preparedSetterArgument ) ; }
Builds code which injects an object which was specified by its object configuration

@param Configuration $objectConfiguration Configuration of the object to inject into
@param string $propertyName Name of the property to inject
@param Configuration $propertyConfiguration Configuration of the object to inject
@return array PHP code
@throws ObjectException\UnknownObjectException
Builds code which injects an object which was specified by its object configuration