Skip to content

Commit 5edebe7

Browse files
author
Caitlin Bales (MSFT)
committed
Fix check for types outside of Microsoft\Graph\Model namespace
1 parent 0c0676e commit 5edebe7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Templates/PHP/Model/EntityType.php.tt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,13 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
117117
public function get<#=propertyName.ToCheckedCase()#>()
118118
{
119119
if (array_key_exists("<#=property.Name.ToCamelize()#>", $this->_propDict)) {
120+
<#
121+
// Check whether this type is a generated model type or a PHP type
122+
if (property.Type.GetTypeString()[0] == '\\') { #>
123+
if (is_a($this->_propDict["<#=property.Name.ToCamelize()#>"], "<#=property.Type.GetTypeString()#>")) {
124+
<# } else { #>
120125
if (is_a($this->_propDict["<#=property.Name.ToCamelize()#>"], "Microsoft\Graph\Model\<#=property.Type.GetTypeString()#>")) {
126+
<# } #>
121127
return $this->_propDict["<#=property.Name.ToCamelize()#>"];
122128
} else {
123129
<# if (property.Type.GetTypeString() == "\\GuzzleHttp\\Psr7\\Stream") { #>

0 commit comments

Comments
 (0)