LdapTools\Query\LdapQuery::getOneOrNullResult PHP Method

getOneOrNullResult() public method

This behaves very similar to getSingleResult(), only if no results are found it will return null instead of throwing an exception.
public getOneOrNullResult ( string $hydratorType = HydratorFactory::TO_OBJECT ) : array | LdapObject | null
$hydratorType string
return array | LdapTools\Object\LdapObject | null
    public function getOneOrNullResult($hydratorType = HydratorFactory::TO_OBJECT)
    {
        try {
            return $this->getSingleResult($hydratorType);
        } catch (EmptyResultException $e) {
            return null;
        }
    }