Permalink
Browse files

Singular form of method names which ends with 'ies' in EntityGenerato…

…r improved
  • Loading branch information...
leonex-cs1 committed Dec 4, 2012
1 parent 287b29a commit a3adfccb4927d61da7debae46ed0fff61e4212f8
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/Doctrine/ORM/Tools/EntityGenerator.php
@@ -930,7 +930,11 @@ private function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $f
{
$methodName = $type . Inflector::classify($fieldName);
if (in_array($type, array("add", "remove")) && substr($methodName, -1) == "s") {
- $methodName = substr($methodName, 0, -1);
+ if (substr($methodName, -3) == "ies") {
+ $methodName = substr($methodName, 0, -3) . "y";
+ } else {
+ $methodName = substr($methodName, 0, -1);
+ }
}
if ($this->hasMethod($methodName, $metadata)) {

0 comments on commit a3adfcc

Please sign in to comment.