@@ -10,7 +10,7 @@ OdcmClass complex = (OdcmClass)host.CurrentType;
1010<#=writer.WriteHeader(writer.GetDocBlock(complex.Name.ToCheckedCase()))#>
1111namespace Microsoft\Graph\Model;
1212<#=writer.GetClassBlock(complex.Name.ToCheckedCase().ToString(), "Model")#>
13- class <#=complex.Name.ToUpperFirstChar()#>
13+ class <#=complex.Name.ToUpperFirstChar()#> extends Entity
1414{
1515 /**
1616 * The array of properties available
@@ -31,6 +31,16 @@ class <#=complex.Name.ToUpperFirstChar()#>
3131 {
3232 $this->_propDict = $propDict;
3333 }
34+
35+ /**
36+ * Gets the property dictionary of the <#=complex.Name.ToCheckedCase()#>
37+ *
38+ * @return array The list of properties
39+ */
40+ public function getProperties()
41+ {
42+ return $this->_propDict;
43+ }
3444<#
3545foreach(var property in complex.Properties.Where(prop => prop.Type.GetTypeString() != "bytes")){
3646 var propertyName = property.Name.ToUnderscore();
@@ -44,15 +54,15 @@ foreach(var property in complex.Properties.Where(prop => prop.Type.GetTypeString
4454 */
4555 public function get<#=property.Name.ToCheckedCase()#>()
4656 {
47- if (array_key_exists("<#=property.Name.ToCamelize()#>", $this->propDict )) {
57+ if (array_key_exists("<#=property.Name.ToCamelize()#>", $this->_propDict )) {
4858<#
4959 if (property.Type.GetTypeString() == "datetime") {
5060#>
5161 return new \DateTime($this->_propDict["<#=property.Name.ToCamelize()#>"]);
5262<#
5363 } else {
5464#>
55- return $this->propDict ["<#=property.Name.ToCamelize()#>"];
65+ return $this->_propDict ["<#=property.Name.ToCamelize()#>"];
5666<#
5767 }
5868#>
@@ -95,12 +105,12 @@ foreach(var property in complex.Properties.Where(prop => prop.Type.GetTypeString
95105 */
96106 public function get<#=property.Name.ToCheckedCase()#>()
97107 {
98- if (array_key_exists("<#=property.Name.ToCamelize()#>", $this->propDict )) {
99- if (is_a($this->propDict ["<#=property.Name.ToCamelize()#>"], '<#=property.Type.GetTypeString()#>')) {
100- return $this->propDict ["<#=property.Name.ToCamelize()#>"];
108+ if (array_key_exists("<#=property.Name.ToCamelize()#>", $this->_propDict )) {
109+ if (is_a($this->_propDict ["<#=property.Name.ToCamelize()#>"], '<#=property.Type.GetTypeString()#>')) {
110+ return $this->_propDict ["<#=property.Name.ToCamelize()#>"];
101111 } else {
102- $this->propDict ["<#=property.Name.ToCamelize()#>"] = new <#=property.Type.GetTypeString()#>($this->propDict ["<#=property.Name.ToCamelize()#>"]);
103- return $this->propDict ["<#=property.Name.ToCamelize()#>"];
112+ $this->_propDict ["<#=property.Name.ToCamelize()#>"] = new <#=property.Type.GetTypeString()#>($this->_propDict ["<#=property.Name.ToCamelize()#>"]);
113+ return $this->_propDict ["<#=property.Name.ToCamelize()#>"];
104114 }
105115 }
106116 return null;
@@ -116,11 +126,11 @@ foreach(var property in complex.Properties.Where(prop => prop.Type.GetTypeString
116126 public function set<#=property.Name.ToCheckedCase()#>($val)
117127 {
118128<# if (property.Type.GetTypeString() == "bool") { #>
119- $this->propDict ["<#=property.Name#>"] = boolval($val);
129+ $this->_propDict ["<#=property.Name#>"] = boolval($val);
120130<# } else if (property.Type.GetTypeString() == "int") { #>
121- $this->propDict ["<#=property.Name#>"] = intval($val);
131+ $this->_propDict ["<#=property.Name#>"] = intval($val);
122132<# } else { #>
123- $this->propDict ["<#=property.Name#>"] = $val;
133+ $this->_propDict ["<#=property.Name#>"] = $val;
124134<# } #>
125135 return $this;
126136 }
0 commit comments