protected function buildSerializeRelatedEntitiesCode(Configuration $objectConfiguration)
{
$className = $objectConfiguration->getClassName();
$code = '';
if ($this->reflectionService->hasMethod($className, '__sleep') === false) {
$transientProperties = $this->reflectionService->getPropertyNamesByAnnotation($className, Flow\Transient::class);
$propertyVarTags = [];
foreach ($this->reflectionService->getPropertyNamesByTag($className, 'var') as $propertyName) {
$varTagValues = $this->reflectionService->getPropertyTagValues($className, $propertyName, 'var');
$propertyVarTags[$propertyName] = isset($varTagValues[0]) ? $varTagValues[0] : null;
}
$code = " \$this->Flow_Object_PropertiesToSerialize = array();\n\n \$transientProperties = " . var_export($transientProperties, true) . ";\n \$propertyVarTags = " . var_export($propertyVarTags, true) . ";\n \$result = \$this->Flow_serializeRelatedEntities(\$transientProperties, \$propertyVarTags);\n";
}
return $code;
}