Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Documented how to add or remove values of multi-valued attributes #9553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions components/ldap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,16 @@ delete existing ones::
$entry = $result[0];
$entry->setAttribute('email', array('[email protected]'));
$entityManager->update($entry);

// Adding or removing values to a multi-valued attribute is more efficient than using update()
$entityManager->addAttributeValues($entry, 'telephoneNumber', array('+1.111.222.3333', '+1.222.333.4444'));
$entityManager->removeAttributeValues($entry, 'telephoneNumber', array('+1.111.222.3333', '+1.222.333.4444'));

// Removing an existing entry
$entityManager->remove(new Entry('cn=Test User,dc=symfony,dc=com'));

.. versionadded:: 4.1
The ``addAttributeValues()`` and ``removeAttributeValues()`` methods
were introduced in Symfony 4.1.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a blank line after this paragraph to have it rendered correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added it.


.. _Packagist: https://packagist.org/packages/symfony/ldap