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

Commit40b2067

Browse files
committed
minor#9715 [LDAP] Add docs for applyOperations method (mablae)
This PR was merged into the master branch.Discussion----------[LDAP] Add docs for applyOperations methodSee PRsymfony/symfony#27069Commits-------74fed75 [LDAP] Add docs for applyOperations method
2 parentsc3c0b55 +74fed75 commit40b2067

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

‎components/ldap.rst‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,38 @@ 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 entry manager's:method:`Symfony\\Component\\Ldap\\Adapter\\ExtLdap\\EntryManager::applyOperations`
145+
method to update multiple attributes at once::
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``,
165+
``LDAP_MODIFY_BATCH_REMOVE_ALL``, ``LDAP_MODIFY_BATCH_REPLACE``. Parameter
166+
``$values`` must be ``NULL`` when using ``LDAP_MODIFY_BATCH_REMOVE_ALL``
167+
operation type.
168+
169+
..versionadded::4.2
170+
The ``applyOperations()`` method was introduced in Symfony 4.2.
171+
140172
..versionadded::4.1
141173
The ``addAttributeValues()`` and ``removeAttributeValues()`` methods
142174
were introduced in Symfony 4.1.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp