if (!
ldap_free_result($result)) { throw new LdapException('Could not free results: '.
ldap_error($con));
} } } public function execute(): CollectionInterface
{ if (!
isset($this->results
)) { // If the connection is not bound, throw an exception. Users should use an explicit bind call first.
if (!
$this->connection->
isBound()) { throw new NotBoundException('Query execution is not possible without binding the connection first.'
);
} $this->results =
[];
$con =
$this->connection->
getResource();
$func =
match ($this->options
['scope'
]) { static::SCOPE_BASE => 'ldap_read',
static::SCOPE_ONE => 'ldap_list',
static::SCOPE_SUB => 'ldap_search',
default =>
throw new LdapException(sprintf('Could not search in scope "%s".',
$this->options
['scope'
])),
};