EntityDecorator.php 854 bytes
<?php
/*
 * © 2016 IRSTEA
 * Guillaume Perréal <guillaume.perreal@irstea.fr>
 * Tous droits réservés.
 */
namespace Irstea\PlantUmlBundle\Doctrine;
use Doctrine\ORM\Mapping\ClassMetadata;
use Irstea\PlantUmlBundle\Model\ClassVisitorInterface;
use Irstea\PlantUmlBundle\Model\NodeInterface;
/**
 * Description of EntityDecorator
 * @author Guillaume Perréal <guillaume.perreal@irstea.fr>
class EntityDecorator extends AbstractDoctrineDecorator
    protected function decorateEntity(ClassMetadata $metadata, NodeInterface $node, ClassVisitorInterface $visitor)
        if ($metadata->isMappedSuperclass) {
            $node->addStereotype('mappedSuperClass');
        } elseif($metadata->isEmbeddedClass) {
            $node->addStereotype('embedded');
        } else {
            $node->addStereotype('entity');