private function resetEntityManager()
    {
        $managers = $this->doctrine->getManagers();
        foreach ($managers as $name => $manager) {
            if (!$manager->getMetadataFactory()->isTransient($this->entityClass)) {
                $this->doctrine->resetManager($name);
                break;
            }
        }
    }