summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-08-06 08:15:18 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-08-06 08:15:18 (GMT)
commit83c210942cce29b25e1ea5cf0e19174924c9f5e0 (patch)
treef88e4a871dc474d17566a3deca25bd8a19817da9
parent1f801f7538533d3670d19561e996b11cec9da85e (diff)
downloadNet_LDAP3-83c210942cce29b25e1ea5cf0e19174924c9f5e0.tar.gz
Add get_dn() method + some CS and documentation fixes
-rw-r--r--lib/Net/LDAP3/Result.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/Net/LDAP3/Result.php b/lib/Net/LDAP3/Result.php
index 728b304..0759df0 100644
--- a/lib/Net/LDAP3/Result.php
+++ b/lib/Net/LDAP3/Result.php
@@ -71,7 +71,7 @@ class Net_LDAP3_Result implements Iterator
}
/**
- *
+ * Wrapper for ldap_sort()
*/
public function sort($attr)
{
@@ -79,18 +79,23 @@ class Net_LDAP3_Result implements Iterator
}
/**
- *
+ * Get entries count
*/
public function count()
{
- if (!isset($this->count))
+ if (!isset($this->count)) {
$this->count = ldap_count_entries($this->conn, $this->result);
+ }
return $this->count;
}
/**
+ * Wrapper for ldap_get_entries()
*
+ * @param bool $normalize Optionally normalize the entries to a list of hash arrays
+ *
+ * @return array List of LDAP entries
*/
public function entries($normalize = false)
{
@@ -103,6 +108,14 @@ class Net_LDAP3_Result implements Iterator
return $entries;
}
+ /**
+ * Wrapper for ldap_get_dn() using the current entry pointer
+ */
+ public function get_dn()
+ {
+ return $this->current ? ldap_get_dn($this->conn, $this->current) : null;
+ }
+
/*** Implement PHP 5 Iterator interface to make foreach work ***/