__construct (Constructor) [line 109]
Net_LDAP2_Search __construct(
resource
&$search, Net_LDAP2|resource
&$ldap, [array
$attributes = array()])
|
|
Constructor
Parameters:
_Net_LDAP2_Search (Destructor) [line 464]
void _Net_LDAP2_Search(
)
|
|
Destructor
as_struct [line 390]
Return entries as array
This method returns the entries and the selected attributes values as array. The first array level contains all found entries where the keys are the DNs of the entries. The second level arrays contian the entries attributes such that the keys is the lowercased name of the attribute and the values are stored in another indexed array. Note that the attribute values are stored in an array even if there is no or just one value.
The array has the following structure: $return = array(
'cn=foo,dc=example,dc=com' => array(
'sn' => array('foo'),
'multival' => array('val1', 'val2', 'valN')
)
'cn=bar,dc=example,dc=com' => array(
'sn' => array('bar'),
'multival' => array('val1', 'valN')
)
)
count [line 440]
Returns the number of entries in the searchresult
current [line 523]
SPL Iterator interface: Return the current element.
The SPL Iterator interface allows you to fetch entries inside a foreach() loop: foreach ($search as $dn => $entry) { ...
Of course, you may call current(), key(), next(), rewind() and valid() yourself.
If the search throwed an error, it returns false. False is also returned, if the end is reached In case no call to next() was made, we will issue one, thus returning the first entry.
done [line 474]
entries [line 134]
Returns an array of entry objects
getErrorCode [line 454]
Get the errorcode the object got in its search.
key [line 539]
SPL Iterator interface: Return the identifying key (DN) of the current entry.
next [line 554]
SPL Iterator interface: Move forward to next entry.
After a call to next(), current() will return the next entry in the result set.
popEntry [line 195]
Retrieve the next entry in the searchresult, but starting from last entry
This is the opposite to shiftEntry() and is also very useful to be used inside a while loop.
pop_entry [line 211]
Alias function of popEntry() for perl-ldap interface
rewind [line 590]
SPL Iterator interface: Rewind the Iterator to the first element.
After rewinding, current() will return the first entry in the result set.
setLink [line 430]
void setLink(
resource
&$link)
|
|
Set the ldap ressource link
Parameters:
setSearch [line 417]
void setSearch(
resource
&$search)
|
|
Set the search objects resource link
Parameters:
shiftEntry [line 154]
Get the next entry in the searchresult.
This will return a valid Net_LDAP2_Entry object or false, so you can use this method to easily iterate over the entries inside a while loop.
shift_entry [line 181]
Alias function of shiftEntry() for perl-ldap interface
sizeLimitExceeded [line 496]
boolean sizeLimitExceeded(
)
|
|
Tells if this search exceeds a sizelimit
sorted [line 345]
array|Net_LDAP2_Error sorted(
[array
$attrs = array('cn')], [int
$order = SORT_ASC])
|
|
Return entries sorted as objects
This returns a array with sorted Net_LDAP2_Entry objects. The sorting is actually done with sorted_as_struct().
Please note that attribute names are case sensitive! Also note, that it is (depending on server capabilitys) possible to let the server sort your results. This happens through search controls and is described in detail at http://www.ietf.org/rfc/rfc2891.txt
Usage example: // to sort entries first by location, then by surename, but descending:
$entries =
$search->sorted(array
('locality','sn'), SORT_DESC
);
Parameters:
sorted_as_struct [line 238]
array|Net_LDAP2_Error sorted_as_struct(
[array
$attrs = array('cn')], [int
$order = SORT_ASC])
|
|
Return entries sorted as array
This returns a array with sorted entries and the values. Sorting is done with PHPs http://www.php.net/array_multisort. This method relies on as_struct() to fetch the raw data of the entries.
Please note that attribute names are case sensitive!
Usage example: // to sort entries first by location, then by surename, but descending:
Parameters:
valid [line 577]
_searchedAttrs [line 486]
Return the attribute names this search selected