protected function buildLifecycleShutdownCode(Configuration $objectConfiguration)
{
$lifecycleShutdownMethodName = $objectConfiguration->getLifecycleShutdownMethodName();
if (!$this->reflectionService->hasMethod($objectConfiguration->getClassName(), $lifecycleShutdownMethodName)) {
return '';
}
$className = $objectConfiguration->getClassName();
$code = "\n" . ' if (get_class($this) === \'' . $className . '\') {' . "\n";
$code .= ' \\Neos\\Flow\\Core\\Bootstrap::$staticObjectManager->registerShutdownObject($this, \'' . $lifecycleShutdownMethodName . '\');' . PHP_EOL;
$code .= ' }' . "\n";
return $code;
}