Add limit argument to ldap_search()
This commit is contained in:
@@ -44,9 +44,10 @@ class Query
|
|||||||
* @param string $baseDn
|
* @param string $baseDn
|
||||||
* @param string $filter
|
* @param string $filter
|
||||||
* @param array $attributes
|
* @param array $attributes
|
||||||
* @return Query
|
* @param integer $limit
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function execute($baseDn, $filter, array $attributes)
|
public function execute($baseDn, $filter, array $attributes, $limit = 0)
|
||||||
{
|
{
|
||||||
if (DEBUG && $this->client->hasLogger()) {
|
if (DEBUG && $this->client->hasLogger()) {
|
||||||
$this->client->getLogger()->debug('BaseDN='.$baseDn);
|
$this->client->getLogger()->debug('BaseDN='.$baseDn);
|
||||||
@@ -54,7 +55,7 @@ class Query
|
|||||||
$this->client->getLogger()->debug('Attributes='.implode(', ', $attributes));
|
$this->client->getLogger()->debug('Attributes='.implode(', ', $attributes));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sr = ldap_search($this->client->getConnection(), $baseDn, $filter, $attributes);
|
$sr = @ldap_search($this->client->getConnection(), $baseDn, $filter, $attributes, null, $limit);
|
||||||
if ($sr === false) {
|
if ($sr === false) {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user