public function isRegistered($entity)
    {
        try {
            $entityId = $this->getEntityId($entity);

            return
                ($this->getEntityState($entity) == EntityStates::REGISTERED)
                || isset($this->entities[$this->getClassName($entity)][$entityId]);
        } catch (OrmException $e) {
            return false;
        }
    }