Class: Net_LDAP2_Filter
Source Location: /Net_LDAP2-2.2.0/Net/LDAP2/Filter.php
PEAR
|
--Net_LDAP2_Filter
Object representation of a part of a LDAP filter.
Author(s):
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
__construct (Constructor) [line 108]
Net_LDAP2_Filter __construct(
[string
$filter = false])
|
|
Create a new Net_LDAP2_Filter object and parse $filter. This is for PERL Net::LDAP interface. Construction of Net_LDAP2_Filter objects should happen through either create() or combine() which give you more control. However, you may use the perl iterface if you already have generated filters.
Parameters:
asString [line 457]
Get the string representation of this filter This method runs through all filter objects and creates the string representation of the filter. If this filter object is a leaf filter, then it will return the string representation of this filter.
as_string [line 477]
Alias for perl interface as_string()
combine [line 248]
Combine two or more filter objects using a logical operator This static method combines two or more filter objects and returns one single filter object that contains all the others. Call this method statically: $filter = Net_LDAP2_Filter::combine('or', array($filter1, $filter2)) If the array contains filter strings instead of filter objects, we will try to parse them.
Parameters:
create [line 164]
Constructor of a new part of a LDAP filter. The following matching rules exists: - equals: One of the attributes values is exactly $value
Please note that case sensitiviness is depends on the
attributes syntax configured in the server.
- begins: One of the attributes values must begin with $value
- ends: One of the attributes values must end with $value
- contains: One of the attributes values must contain $value
- present | any: The attribute can contain any value but must be existent
- greater: The attributes value is greater than $value
- less: The attributes value is less than $value
- greaterOrEqual: The attributes value is greater or equal than $value
- lessOrEqual: The attributes value is less or equal than $value
- approx: One of the attributes values is similar to $value
Negation ("not") can be done by prepending the above operators with the "not" or "!" keyword, see example below. If $escape is set to true (default) then $value will be escaped properly. If it is set to false then $value will be treaten as raw filter value string. You should escape yourself using Net_LDAP2_Util::escape_filter_value()! Examples: // This will find entries that contain an attribute "sn" that ends with "foobar":
// This will find entries that contain an attribute "sn" that has any value set:
// This will build a negated equals filter:
Parameters:
escape [line 538]
string escape(
string
$value)
|
|
This can be used to escape a string to provide a valid LDAP-Filter. LDAP will only recognise certain characters as the character istself if they are properly escaped. This is what this method does. The method can be called statically, so you can use it outside for your own purposes (eg for escaping only parts of strings) In fact, this is just a shorthand to Net_LDAP2_Util::escape_filter_value(). For upward compatibiliy reasons you are strongly encouraged to use the escape methods provided by the Net_LDAP2_Util class.
Parameters:
getComponents [line 659]
Retrieve this leaf-filters attribute, match and value component. For leaf filters, this returns array(attr, match, value). Match is be the logical operator, not the text representation, eg "=" instead of "equals". Note that some operators are really a combination of operator+value with wildcard, like "begins": That will return "=" with the value "value*"! For non-leaf filters this will drop an error.
isLeaf [line 550]
Is this a container or a leaf filter object?
matches [line 569]
Filter entries using this filter or see if a filter matches
Parameters:
parse [line 328]
Parse FILTER into a Net_LDAP2_Filter object This parses an filter string into Net_LDAP2_Filter objects.
Parameters:
printMe [line 493]
Print the text representation of the filter to FH, or the currently selected output handle if FH is not given This method is only for compatibility to the perl interface. However, the original method was called "print" but due to PHP language restrictions, we can't have a print() method.
Parameters:
Documentation generated on Mon, 11 Mar 2019 16:03:54 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|