1
0
mirror of synced 2025-01-30 20:11:49 +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> * <description>
* *
* @param <variableType>$<variableName> * @param <variableType>$<variableName>
* @return <entity>
*/ */
public function <methodName>(<methodTypeHint>$<variableName>) public function <methodName>(<methodTypeHint>$<variableName>)
{ {
<spaces>$this-><fieldName> = $<variableName>; <spaces>$this-><fieldName> = $<variableName>;
<spaces>return $this;
}'; }';
private static $_addMethodTemplate = private static $_addMethodTemplate =
@ -734,7 +736,8 @@ public function <methodName>()
'<variableType>' => $variableType, '<variableType>' => $variableType,
'<variableName>' => Inflector::camelize($fieldName), '<variableName>' => Inflector::camelize($fieldName),
'<methodName>' => $methodName, '<methodName>' => $methodName,
'<fieldName>' => $fieldName '<fieldName>' => $fieldName,
'<entity>' => $this->_getClassName($metadata)
); );
$method = str_replace( $method = str_replace(