svn: /pear/peardoc/trunk/en/package/networking/net-ldap/ filter.xml

From: Date: Mon, 09 Dec 2013 08:52:47 +0000
Subject: svn: /pear/peardoc/trunk/en/package/networking/net-ldap/ filter.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-12218@lists.php.net to get a copy of this message
beni Mon, 09 Dec 2013 08:52:47 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=332306 Log: * Documented client side filtering Changed paths: U pear/peardoc/trunk/en/package/networking/net-ldap/filter.xml Modified: pear/peardoc/trunk/en/package/networking/net-ldap/filter.xml =================================================================== --- pear/peardoc/trunk/en/package/networking/net-ldap/filter.xml 2013-12-09 08:51:41 UTC (rev 332305) +++ pear/peardoc/trunk/en/package/networking/net-ldap/filter.xml 2013-12-09 08:52:47 UTC (rev 332306) @@ -234,6 +234,59 @@ </example> </para> </refsection> + + <refsection><info><title>Client side filtering</title></info> + + <para> + Since version 2.0.13 the filter class can filter entries client side. Just pass an entry + or an array of entries to the filter objects <function>matches</function>. With this you can + check that an given entry matches some LDAP filter as well as select matching entries out of + an array containing many of them. + <table><title>supported features</title> + + <tgroup cols="2"> + <thead> + <row> + <entry>Feature</entry> + <entry>Description</entry> + <entry>Since</entry> + </row> + </thead> + <tbody> + <row><entry>Matching Operators: <literal>equals</literal>, <literal>begins</literal>, <literal>ends</literal>, <literal>contains</literal></entry><entry>Matching of the basic "=" filter argument with wildcards in value</entry><entry>2.0.13</entry></row> + <row><entry>Matching Operators: <literal>greater</literal>, <literal>greaterOrEqual</literal>, <literal>less</literal>, <literal>lessOrEqual</literal>, <literal>approx</literal></entry><entry>Comparisons and approximate literal matching</entry><entry>unsupported</entry></row> + <row><entry>Matching rules of attribute syntax</entry><entry>Using of the matching rule of the schema attribute syntax</entry><entry>unsupported</entry> + <row><entry>Logical Operators: <literal>AND</literal>, <literal>OR</literal>, <literal>NOT</literal></entry><entry>Combining filters for more advanced expressions.</entry><entry>2.0.13</entry></row> + + </tbody> + </tgroup> + </table> + + <example><info><title>Client side filter matching</title></info> + + <programlisting role="php"><![CDATA[ +// Create a simple test filter (may be arbitary complex and combined) +$filter = Net_LDAP_Filter::create('givenName', 'equals', 'Benedikt'); + +// see if the filter matches a given Entry +// (note that you should check for Net_LDAP2_Error) +$matches_count = $filter->matches($singleEntry); +// $matches_count contains the number of matched entries, here 0 or 1. + +// see, if the filter matches some entries of a given array of entries +$matches_count = $filter->matches($arrayOfEntries); +// $matches_count contains again the number of matched entries, here 0 or n. + +// what entries do match exactly? +$filteredEntries = array(); +$matches_count = $filter->matches($arrayOfEntries $filteredEntries); +// $filteredEntries array contains now all matched entries, eg a filtered result. + +]]></programlisting> + </example> + </para> + </refsection> + <refsection><info><title>Advanced features</title></info> <para>

« previous php.pear.doc (#12218) next »