Skip to content

Commit 8683f06

Browse files
author
Caitlin Bales (MSFT)
committed
Return object on setters
1 parent b62b721 commit 8683f06

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Templates/PHP/Model/ComplexType.php.tt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class <#=complex.Name.ToUpperFirstChar()#>
8282
<#
8383
}
8484
#>
85+
return $this;
8586
}
8687
<#
8788
} else {
@@ -110,7 +111,7 @@ class <#=complex.Name.ToUpperFirstChar()#>
110111
*
111112
* @param <#=property.Type.GetTypeString()#> $val The value to assign to the <#=property.Name#>
112113
*
113-
* @return null
114+
* @return The <#=complex.Name.ToUpperFirstChar()#>
114115
*/
115116
public function set<#=property.Name.ToCheckedCase()#>($val)
116117
{
@@ -121,6 +122,7 @@ class <#=complex.Name.ToUpperFirstChar()#>
121122
<# } else { #>
122123
$this->propDict["<#=property.Name#>"] = $val;
123124
<# } #>
125+
return $this;
124126
}
125127
<#
126128
}

Templates/PHP/Model/EntityType.php.tt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class <#=entity.Name.ToCheckedCase()#>
9090
*
9191
* @param string $val The <#=property.Name#>
9292
*
93-
* @return null
93+
* @return <#=entity.Name.ToCheckedCase()#>
9494
*/
9595
public function set<#=property.Name.ToCheckedCase()#>($val)
9696
{
@@ -101,6 +101,7 @@ class <#=entity.Name.ToCheckedCase()#>
101101
<# } else { #>
102102
$this->propDict["<#=property.Name#>"] = $val;
103103
<# } #>
104+
return $this;
104105
}
105106
<#
106107
}
@@ -136,7 +137,7 @@ class <#=entity.Name.ToCheckedCase()#>
136137
*
137138
* @param <#=property.Type.GetTypeString()#> $val The <#=property.Name#>
138139
*
139-
* @return null
140+
* @return <#=entity.Name.ToCheckedCase()#>
140141
*/
141142
public function set<#=property.Name.ToCheckedCase()#>($val)
142143
{
@@ -158,6 +159,7 @@ class <#=entity.Name.ToCheckedCase()#>
158159
<#
159160
}
160161
#>
162+
return $this;
161163
}
162164
<#
163165
}

0 commit comments

Comments
 (0)