Doctrine\ODM\MongoDB\Tools\DocumentGenerator::generateDocumentClass PHP Méthode

generateDocumentClass() public méthode

Generate a PHP5 Doctrine 2 document class from the given ClassMetadataInfo instance
public generateDocumentClass ( ClassMetadataInfo $metadata ) : string
$metadata Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo
Résultat string $code
    public function generateDocumentClass(ClassMetadataInfo $metadata)
    {
        $placeHolders = array('<namespace>', '<imports>', '<documentAnnotation>', '<documentClassName>', '<documentBody>');
        $replacements = array($this->generateDocumentNamespace($metadata), $this->generateDocumentImports(), $this->generateDocumentDocBlock($metadata), $this->generateDocumentClassName($metadata), $this->generateDocumentBody($metadata));
        $code = str_replace($placeHolders, $replacements, self::$classTemplate);
        return str_replace('<spaces>', $this->spaces, $code);
    }