No need to retrieve all records by default when getting children. By default sort records by DN until we implemented configurable sorting.
Should help the timeout issues reported in #301
This commit is contained in:
parent
fd2c5d1286
commit
eab4f0427c
@ -247,14 +247,15 @@ final class Server
|
||||
* @param string $dn
|
||||
* @return LDAPCollection|NULL
|
||||
*/
|
||||
public function children(string $dn): ?LDAPCollection
|
||||
public function children(string $dn,array $attrs=['dn']): ?LDAPCollection
|
||||
{
|
||||
return ($x=(new Entry)
|
||||
->on($this->connection)
|
||||
->cache(Carbon::now()->addSeconds(Config::get('ldap.cache.time')))
|
||||
->select(['*','hassubordinates'])
|
||||
->select(array_merge($attrs,['hassubordinates']))
|
||||
->setDn($dn)
|
||||
->list()
|
||||
->orderBy('dn')
|
||||
->get()) ? $x : NULL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user