-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Conversation
components/ldap.rst
Outdated
@@ -129,6 +129,10 @@ 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', ['+1.111.222.3333', '+1.222.333.4444']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency please us the long array notation here.
I would also add a .. versionadded:: 4.1
The ``addAttributeValues()`` and ``removeAttributeValues()`` methods
were introduced in Symfony 4.1. |
@xabbuh Done. |
|
||
// 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added it.
@jean-gui thanks for adding this missing docs. It was a nice first contribution to Symfony Docs! |
…tributes (jean-gui) This PR was merged into the master branch. Discussion ---------- Documented how to add or remove values of multi-valued attributes Related to symfony/symfony#21856 <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 40df041 Documented how to add or remove values of multi-valued attributes
Related to symfony/symfony#21856