Forked from HYCAR-Hydro / airGR
Source project has a limited visibility.
EntityFinder.php 865 bytes
<?php
/*
 * © 2016 IRSTEA
 * Guillaume Perréal <guillaume.perreal@irstea.fr>
 * Tous droits réservés.
 */
namespace Irstea\PlantUmlBundle\Doctrine;
use ArrayIterator;
use Doctrine\ORM\EntityManager;
use Irstea\PlantUmlBundle\Finder\FinderInterface;
/**
 * @author Guillaume Perréal <guillaume.perreal@irstea.fr>
class EntityFinder implements FinderInterface
    /**
     * @var EntityManager
    private $entityManager;
    public function __construct(EntityManager $entityManager)
        $this->entityManager = $entityManager;
    public function getIterator()
        $classes = [];
        foreach($this->entityManager->getMetadataFactory()->getAllMetadata() as $metadata) {
            $classes[$metadata->getName()] = $metadata->getReflectionClass();
        return new ArrayIterator($classes);