. */ namespace Sikofitt\App\Traits; use Doctrine\ORM\EntityManager; trait EntityManagerTrait { /** * @return null|EntityManager */ public function getEntityManager() { if (false === isset($this['orm.em']) || false === isset($this['db.options'])) { return null; } return $this['orm.em']; } }