Add "return $this" to generated methods to get a fluent Enttity class
This commit is contained in:
parent
2ae3bb6e3a
commit
2b334977f5
@ -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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user