From 2b334977f536e0d4f473ed1faa748d8c37de97db Mon Sep 17 00:00:00 2001 From: Benjamin Date: Tue, 20 Sep 2011 14:59:32 +0200 Subject: [PATCH 1/3] Add "return $this" to generated methods to get a fluent Enttity class --- lib/Doctrine/ORM/Tools/EntityGenerator.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index e53505f98..bfe562fb2 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -115,10 +115,12 @@ public function () * * * @param $ + * @return */ public function ($) { $this-> = $; +return $this; }'; private static $_addMethodTemplate = @@ -734,7 +736,8 @@ public function () '' => $variableType, '' => Inflector::camelize($fieldName), '' => $methodName, - '' => $fieldName + '' => $fieldName, + '' => $this->_getClassName($metadata) ); $method = str_replace( From 944f802d79baaf5eb16aaa86f8b7698e3fa9af17 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Tue, 20 Sep 2011 15:35:16 +0200 Subject: [PATCH 2/3] Correct indentation --- lib/Doctrine/ORM/Tools/EntityGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index bfe562fb2..96c3b0136 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -737,7 +737,7 @@ public function () '' => Inflector::camelize($fieldName), '' => $methodName, '' => $fieldName, - '' => $this->_getClassName($metadata) + '' => $this->_getClassName($metadata) ); $method = str_replace( From 01d900d5d7b4d60616d6c2565ab46eaffb93046b Mon Sep 17 00:00:00 2001 From: Benjamin Date: Tue, 20 Sep 2011 15:50:32 +0200 Subject: [PATCH 3/3] tab <-> spaces --- lib/Doctrine/ORM/Tools/EntityGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index 96c3b0136..eb00cc8fc 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -737,7 +737,7 @@ public function () '' => Inflector::camelize($fieldName), '' => $methodName, '' => $fieldName, - '' => $this->_getClassName($metadata) + '' => $this->_getClassName($metadata) ); $method = str_replace(