private function generateDocumentBody(ClassMetadataInfo $metadata) { $fieldMappingProperties = $this->generateDocumentFieldMappingProperties($metadata); $associationMappingProperties = $this->generateDocumentAssociationMappingProperties($metadata); $stubMethods = $this->generateDocumentStubMethods ? $this->generateDocumentStubMethods($metadata) : null; $lifecycleCallbackMethods = $this->generateDocumentLifecycleCallbackMethods($metadata); $code = array(); if ($fieldMappingProperties) { $code[] = $fieldMappingProperties; } if ($associationMappingProperties) { $code[] = $associationMappingProperties; } $code[] = $this->generateDocumentConstructor($metadata); if ($stubMethods) { $code[] = $stubMethods; } if ($lifecycleCallbackMethods) { $code[] = "\n" . $lifecycleCallbackMethods; } return implode("\n", $code); }