protected function buildSetInstanceCode(Configuration $objectConfiguration)
    {
        if ($objectConfiguration->getScope() === Configuration::SCOPE_PROTOTYPE) {
            return '';
        }

        $code = '        if (get_class($this) === \'' . $objectConfiguration->getClassName() . '\') \Neos\Flow\Core\Bootstrap::$staticObjectManager->setInstance(\'' . $objectConfiguration->getObjectName() . '\', $this);' . "\n";

        $className = $objectConfiguration->getClassName();
        foreach ($this->objectConfigurations as $otherObjectConfiguration) {
            if ($otherObjectConfiguration !== $objectConfiguration && $otherObjectConfiguration->getClassName() === $className) {
                $code .= '        if (get_class($this) === \'' . $otherObjectConfiguration->getClassName() . '\') \Neos\Flow\Core\Bootstrap::$staticObjectManager->setInstance(\'' . $otherObjectConfiguration->getObjectName() . '\', $this);' . "\n";
            }
        }

        return $code;
    }
protected function buildSetInstanceCode(Configuration $objectConfiguration)
    {
        if ($objectConfiguration->getScope() === Configuration::SCOPE_PROTOTYPE) {
            return '';
        }

        $code = '        if (get_class($this) === \'' . $objectConfiguration->getClassName() . '\') \Neos\Flow\Core\Bootstrap::$staticObjectManager->setInstance(\'' . $objectConfiguration->getObjectName() . '\', $this);' . "\n";

        $className = $objectConfiguration->getClassName();
        foreach ($this->objectConfigurations as $otherObjectConfiguration) {
            if ($otherObjectConfiguration !== $objectConfiguration && $otherObjectConfiguration->getClassName() === $className) {
                $code .= '        if (get_class($this) === \'' . $otherObjectConfiguration->getClassName() . '\') \Neos\Flow\Core\Bootstrap::$staticObjectManager->setInstance(\'' . $otherObjectConfiguration->getObjectName() . '\', $this);' . "\n";
            }
        }

        return $code;
    }
protected function buildSetInstanceCode ( Configuration $ objectConfiguration ) { if ( $ objectConfiguration -> getScope ( ) === Configuration :: SCOPE_PROTOTYPE ) { return '' ; } $ code = '        if (get_class($this) === \'' . $ objectConfiguration -> getClassName ( ) . '\') \Neos\Flow\Core\Bootstrap::$staticObjectManager->setInstance(\'' . $ objectConfiguration -> getObjectName ( ) . '\', $this);' . "\n" ; $ className = $ objectConfiguration -> getClassName ( ) ; foreach ( $ this -> objectConfigurations as $ otherObjectConfiguration ) { if ( $ otherObjectConfiguration !== $ objectConfiguration && $ otherObjectConfiguration -> getClassName ( ) === $ className ) { $ code .= '        if (get_class($this) === \'' . $ otherObjectConfiguration -> getClassName ( ) . '\') \Neos\Flow\Core\Bootstrap::$staticObjectManager->setInstance(\'' . $ otherObjectConfiguration -> getObjectName ( ) . '\', $this);' . "\n" ; } } return $ code ; }
Renders additional code which registers the instance of the proxy class at the Object Manager
before constructor injection is executed. Used in constructors and wakeup methods.

This also makes sure that object creation does not end in an endless loop due to bi-directional dependencies.

@param Configuration $objectConfiguration
@return string
Renders additional code which registers the instance of the proxy class at the Object Manager before constructor injection is executed . Used in constructors and wakeup methods .