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

buildLifecycleInitializationCode() защищенный Метод

Builds code which calls the lifecycle initialization method, if any.
protected buildLifecycleInitializationCode ( Configuration $objectConfiguration, integer $cause ) : string
$objectConfiguration Neos\Flow\ObjectManagement\Configuration\Configuration
$cause integer a \Neos\Flow\ObjectManagement\ObjectManagerInterface::INITIALIZATIONCAUSE_* constant which is the cause of the initialization command being called.
Результат string
    protected function buildLifecycleInitializationCode(Configuration $objectConfiguration, $cause)
    {
        $lifecycleInitializationMethodName = $objectConfiguration->getLifecycleInitializationMethodName();
        if (!$this->reflectionService->hasMethod($objectConfiguration->getClassName(), $lifecycleInitializationMethodName)) {
            return '';
        }
        $className = $objectConfiguration->getClassName();
        $code = "\n" . '        if (get_class($this) === \'' . $className . '\') {' . "\n";
        $code .= '            $this->' . $lifecycleInitializationMethodName . '(' . $cause . ');' . "\n";
        $code .= '        }' . "\n";
        return $code;
    }