1
0
mirror of synced 2025-01-18 22:41:43 +03:00

Use inflector for add/remove methods

This commit is contained in:
Vladislav Veselinov 2013-02-28 21:05:41 +02:00
parent e5779a0756
commit 30fd22a260

View File

@ -1092,8 +1092,8 @@ public function __construct()
protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null)
{
$methodName = $type . Inflector::classify($fieldName);
if (in_array($type, array("add", "remove")) && substr($methodName, -1) == "s") {
$methodName = substr($methodName, 0, -1);
if (in_array($type, array("add", "remove"))) {
$methodName = Inflector::singularize($methodName);
}
if ($this->hasMethod($methodName, $metadata)) {