__construct (Constructor) [line 134]
Net_LDAP2_Search __construct(
resource
&$search, Net_LDAP2|resource
&$ldap, [array
$attributes = array()])
|
|
Constructor
Parameters:
_Net_LDAP2_Search (Destructor) [line 492]
void _Net_LDAP2_Search(
)
|
|
Destructor
as_struct [line 412]
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 462]
Returns the number of entries in the searchresult
current [line 551]
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 502]
entries [line 159]
Returns an array of entry objects
getErrorCode [line 482]
Get the errorcode the object got in its search.
key [line 567]
SPL Iterator interface: Return the identifying key (DN) of the current entry.
next [line 582]
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 216]
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 233]
Alias function of popEntry() for perl-ldap interface
rewind [line 618]
SPL Iterator interface: Rewind the Iterator to the first element.
After rewinding, current() will return the first entry in the result set.
searchedAttrs [line 514]
Return the attribute names this search selected
setLink [line 452]
void setLink(
resource
&$link)
|
|
Set the ldap ressource link
Parameters:
setSearch [line 439]
void setSearch(
resource
&$search)
|
|
Set the search objects resource link
Parameters:
shiftEntry [line 179]
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 202]
Alias function of shiftEntry() for perl-ldap interface
sizeLimitExceeded [line 524]
boolean sizeLimitExceeded(
)
|
|
Tells if this search exceeds a sizelimit
sorted [line 367]
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 260]
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 605]