LdapTools\Query\LdapQuery::execute PHP Method

execute() public method

Execute a query based on the set parameters. Optionally choose a mode to hydrate the results in.
public execute ( string $hydratorType = HydratorFactory::TO_OBJECT ) : mixed
$hydratorType string A hyrdrator type constant from the factory.
return mixed
    public function execute($hydratorType = HydratorFactory::TO_OBJECT)
    {
        if (is_string($this->operation->getFilter()) || empty($this->operation->getFilter()->getAliases())) {
            $results = $this->getResultsFromLdap(clone $this->operation, $hydratorType);
        } else {
            $results = $this->getResultsForAliases($hydratorType);
        }
        return $this->sortResults($results);
    }