Kdyby\Doctrine\EntityManager::fetchOne PHP Method

fetchOne() public method

public fetchOne ( Kdyby\Persistence\Query $queryObject ) : object | null
$queryObject Kdyby\Persistence\Query
return object | null
    public function fetchOne(Persistence\Query $queryObject)
    {
        try {
            return $queryObject->fetchOne($this);
        } catch (Doctrine\ORM\NoResultException $e) {
            return NULL;
        } catch (Doctrine\ORM\NonUniqueResultException $e) {
            // this should never happen!
            throw new InvalidStateException("You have to setup your query calling ->setMaxResult(1).", 0, $e);
        } catch (\Exception $e) {
            throw $this->handleQueryException($e, $queryObject);
        }
    }