1
0
mirror of synced 2025-01-29 19:41:45 +03:00

Add "return $this" to generated methods to get a fluent Enttity class

This commit is contained in:
Benjamin 2011-09-20 14:59:32 +02:00
parent 2ae3bb6e3a
commit 2b334977f5

View File

@ -115,10 +115,12 @@ public function <methodName>()
* <description>
*
* @param <variableType>$<variableName>
* @return <entity>
*/
public function <methodName>(<methodTypeHint>$<variableName>)
{
<spaces>$this-><fieldName> = $<variableName>;
<spaces>return $this;
}';
private static $_addMethodTemplate =
@ -734,7 +736,8 @@ public function <methodName>()
'<variableType>' => $variableType,
'<variableName>' => Inflector::camelize($fieldName),
'<methodName>' => $methodName,
'<fieldName>' => $fieldName
'<fieldName>' => $fieldName,
'<entity>' => $this->_getClassName($metadata)
);
$method = str_replace(