public function getOneOrNullResult($hydrationMode = null)
    {
        $result = $this->execute(null, $hydrationMode);

        if (count($result) > 1) {
            throw QueryException::nonUniqueResult();
        } elseif (count($result) <= 0) {
            return;
        }

        return $result->first();
    }
public function getOneOrNullResult($hydrationMode = null)
    {
        $result = $this->execute(null, $hydrationMode);

        if (count($result) > 1) {
            throw QueryException::nonUniqueResult();
        } elseif (count($result) <= 0) {
            return;
        }

        return $result->first();
    }
public function getOneOrNullResult ( $ hydrationMode = null ) { $ result = $ this -> execute ( null , $ hydrationMode ) ; if ( count ( $ result ) > 1 ) { throw QueryException :: nonUniqueResult ( ) ; } elseif ( count ( $ result ) <= 0 ) { return ; } return $ result -> first ( ) ; }
Get exactly one result or null.

@param int $hydrationMode

@throws QueryException if more than one result found

@return mixed
Get exactly one result or null .