Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[LDAP] Allow adding and removing values to/from multi-valued attributes #21856
This PR adds two methods to Symfony\Component\Ldap\Adapter\ExtLdap\EntryManager taking advantage of ldap_mod_add and ldap_mod_del.
I thought about using them directly in the update method, but since you need to know what values to add and remove, it would be necessary to retrieve the old values from LDAP.
I'm also unsure whether these two methods should be in an interface. I think that adding them to EntryManagerInterface would break BC, but I could create another interface, similarly to RenameEntryInterface.
I think that we could improve this by introducing a new API for handling changes.
Instead of using separate methods for different things, we should rather use a Command pattern, and provide a set of commands which could be implemented without breaking the interface each time we need to implement something.
This way, we could have a runCommand() method in the EntryManager, with a list of operations:
This would support the current set, and we could deprecate the other methods afterwards.
What do you think about this @nicolas-grekas ?
referenced this pull request
Mar 5, 2017
We can do that. Like I mentioned before, I no longer contribute to Symfony on a regular basis.
One thing though. I would change the method name to removeAttributeValues / addAttributeValues.
Second, this PR should be updated to take into account changes in coding standards for Symfony 4 (PHP > 7.1.3 is used, so scalar type hinting can be used now).
By the way,
some small comments (mainly coding standard).