public function getEntity()
    {
        $entity = $this->entityManager->getRepository($this->className)->find($this->id);
        if (!$entity) {
            throw new Error('Entity not found for class `' . $this->className . '` and ID `' . $this->id . '`.');
        }

        return $entity;
    }
public function getEntity()
    {
        $entity = $this->entityManager->getRepository($this->className)->find($this->id);
        if (!$entity) {
            throw new Error('Entity not found for class `' . $this->className . '` and ID `' . $this->id . '`.');
        }

        return $entity;
    }
public function getEntity ( ) { $ entity = $ this -> entityManager -> getRepository ( $ this -> className ) -> find ( $ this -> id ) ; if ( ! $ entity ) { throw new Error ( 'Entity not found for class `' . $ this -> className . '` and ID `' . $ this -> id . '`.' ) ; } return $ entity ; }
Get the entity from DB

@throws Error

@return mixed entity
Get the entity from DB