Skip to content

Commit 5cbb03f

Browse files
author
Caitlin Bales (MSFT)
committed
Add provision for serializing enums
1 parent b481444 commit 5cbb03f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Templates/PHP/Model/EntityType.php.tt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ if (property.Type.GetTypeString()[0] == '\\') { #>
266266
foreach ($serializableProperties as $property => $val) {
267267
if (is_a($val, "\DateTime")) {
268268
$serializableProperties[$property] = $val->format(\DateTime::RFC3339);
269+
} else if (is_a($val, "\Microsoft\Graph\Core\Enum")) {
270+
$serializableProperties[$property] = $val->value();
269271
}
270272
}
271273
return $serializableProperties;

0 commit comments

Comments
 (0)