doctrine/mongodb-odm — pull request #627 by NicolasMassart (2013-07-04 15:43:53+00:00)
Title: plural to singular conversion of "add" and "remove" methods

plural to singular conversion of "add" and "remove" methods and parameters names

As said in the TODO at line 707 "This needs actual plural -> singular conversion".
So this patch uses Symfony\Component\PropertyAccess\StringUtil::singularify() to make a singular from the property name.

Note that singularify() may return an array when multiple singulars are possible. But as the plural map in singularify() is ordered by plural weight, most of the time the first singular in the array is ok. At least it covers most cases and uses standard Symfony tool.