LdapTools\Query\LdapQuery::getOneOrNullResult PHP 메소드

getOneOrNullResult() 공개 메소드

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
리턴 array | LdapTools\Object\LdapObject | null
    public function getOneOrNullResult($hydratorType = HydratorFactory::TO_OBJECT)
    {
        try {
            return $this->getSingleResult($hydratorType);
        } catch (EmptyResultException $e) {
            return null;
        }
    }