Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit933a5bd

Browse files
authored
[LDAP] Add docs for applyOperations method
See PRsymfony/symfony#27069
1 parenta6a8c37 commit933a5bd

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

‎components/ldap.rst‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,35 @@ delete existing ones::
137137
// Removing an existing entry
138138
$entryManager->remove(new Entry('cn=Test User,dc=symfony,dc=com'));
139139

140+
141+
Batch Updating
142+
___________
143+
144+
Use the EntryManager's ``applyOperations()`` method to update multiple attributes at once::
145+
146+
147+
use Symfony\Component\Ldap\Ldap;
148+
use Symfony\Component\Ldap\Entry;
149+
// ...
150+
151+
$entry = new Entry('cn=Fabien Potencier,dc=symfony,dc=com', array(
152+
'sn' => array('fabpot'),
153+
'objectClass' => array('inetOrgPerson'),
154+
));
155+
156+
$entryManager = $ldap->getEntryManager();
157+
158+
// Adding multiple email adresses at once
159+
$entryManager->applyOperations($entry->getDn(), array(
160+
new UpdateOpteration(LDAP_MODIFY_BATCH_ADD, 'mail', 'new1@example.com'),
161+
new UpdateOpteration(LDAP_MODIFY_BATCH_ADD, 'mail', 'new2@example.com'),
162+
));
163+
164+
Possible operation types are ``LDAP_MODIFY_BATCH_ADD``, ``LDAP_MODIFY_BATCH_REMOVE``, ``LDAP_MODIFY_BATCH_REMOVE_ALL``, ``LDAP_MODIFY_BATCH_REPLACE``. Parameter ``$values`` must be ``NULL`` when using ``LDAP_MODIFY_BATCH_REMOVE_ALL`` operation type.
165+
166+
..versionadded::4.2
167+
The ``applyOperations()`` was introduced in Symfony 4.2.
168+
140169
..versionadded::4.1
141170
The ``addAttributeValues()`` and ``removeAttributeValues()`` methods
142171
were introduced in Symfony 4.1.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp