Skip to content

Commit 4d8040d

Browse files
committed
Mentioned the LDAP query scopes
1 parent 70ff9a3 commit 4d8040d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

components/ldap.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@ array, you may use the
103103

104104
// Do something with the results array
105105

106+
By default, LDAP queries use the ``Symfony\Component\Ldap\Adapter::SCOPE_SUB``
107+
scope, which corresponds to the ``LDAP_SCOPE_SUBTREE`` scope of the
108+
:phpfunction:`ldap_search` function. You can also use ``SCOPE_BASE`` (related
109+
to the ``LDAP_SCOPE_BASE`` scope of :phpfunction:`ldap_read`) and ``SCOPE_ONE``
110+
(related to the ``LDAP_SCOPE_ONELEVEL`` scope of :phpfunction:`ldap_list`)::
111+
112+
use Symfony\Component\Ldap\Adapter;
113+
114+
$query = $ldap->query('dc=symfony,dc=com', '...', ['scope' => Adapter::SCOPE_ONE]);
115+
106116
Creating or Updating Entries
107117
----------------------------
108118

0 commit comments

Comments
 (0)