public function getSingleResult($hydrationMode = null)
    {
        $this->query->setSize(1);
        $results = $this->getResult($hydrationMode);
        if (count($results) < 1) {
            throw new NoResultException('No results found');
        }
        return $results[0];
    }
public function getSingleResult($hydrationMode = null)
    {
        $this->query->setSize(1);
        $results = $this->getResult($hydrationMode);
        if (count($results) < 1) {
            throw new NoResultException('No results found');
        }
        return $results[0];
    }
public function getSingleResult ( $ hydrationMode = null ) { $ this -> query -> setSize ( 1 ) ; $ results = $ this -> getResult ( $ hydrationMode ) ; if ( count ( $ results ) < 1 ) { throw new NoResultException ( 'No results found' ) ; } return $ results [ 0 ] ; }
Execute search for single result and hydrate results if required.

@param integer $hydrationMode
@throws NoResultException
@return mixed
Execute search for single result and hydrate results if required .