public function persist($entity) { if (!is_object($entity)) { throw new \Exception('EntityManager::persist() expects an object'); } $this->uow->persist($entity); }