1
0
mirror of synced 2025-01-30 20:11:49 +03:00

Merge pull request #594 from v3labs/master

Use inflector in EntityGenerator
This commit is contained in:
Guilherme Blanco 2013-02-28 16:02:20 -08:00
commit 2372a85d9f

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)) {