public function __construct(array $mapping = [], EntityManager $em, TemplateChooser $chooser = null)
{
$this->mapping = $mapping;
$this->chooser = $chooser;
$this->em = $em;
if ($em) {
$this->setPlatform($em->createQueryBuilder()->getConnection()->getDatabasePlatform());
}
}