Attachment.php
1 year ago
Attendee.php
1 year ago
AttendeeBase.php
1 year ago
AttendeeType.php
1 year ago
BodyType.php
1 year ago
Calendar.php
1 year ago
CalendarColor.php
1 year ago
DateTimeTimeZone.php
1 year ago
DayOfWeek.php
1 year ago
EmailAddress.php
1 year ago
Entity.php
1 year ago
Event.php
1 year ago
EventType.php
1 year ago
FileAttachment.php
6 months ago
FollowupFlag.php
1 year ago
FollowupFlagStatus.php
1 year ago
FreeBusyStatus.php
1 year ago
Importance.php
1 year ago
InferenceClassificationType.php
1 year ago
ItemBody.php
1 year ago
Location.php
1 year ago
Message.php
6 months ago
OnlineMeetingInfo.php
1 year ago
OnlineMeetingProviderType.php
1 year ago
OutlookGeoCoordinates.php
1 year ago
OutlookItem.php
1 year ago
PatternedRecurrence.php
1 year ago
Phone.php
1 year ago
PhoneType.php
1 year ago
PhysicalAddress.php
1 year ago
Recipient.php
1 year ago
RecurrencePattern.php
1 year ago
RecurrencePatternType.php
1 year ago
RecurrenceRange.php
1 year ago
RecurrenceRangeType.php
1 year ago
ResponseStatus.php
1 year ago
ResponseType.php
1 year ago
Sensitivity.php
1 year ago
SingleValueLegacyExtendedProperty.php
1 year ago
TimeSlot.php
1 year ago
WeekIndex.php
1 year ago
Entity.php
135 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. |
| 4 | * |
| 5 | * Entity File |
| 6 | * PHP version 7 |
| 7 | * |
| 8 | * @category Library |
| 9 | * @package Microsoft.Graph |
| 10 | * @copyright (c) Microsoft Corporation. All rights reserved. |
| 11 | * @license https://opensource.org/licenses/MIT MIT License |
| 12 | * @link https://graph.microsoft.com |
| 13 | */ |
| 14 | namespace Microsoft\Graph\Model; |
| 15 | |
| 16 | /** |
| 17 | * Entity class |
| 18 | * |
| 19 | * @category Model |
| 20 | * @package Microsoft.Graph |
| 21 | * @copyright (c) Microsoft Corporation. All rights reserved. |
| 22 | * @license https://opensource.org/licenses/MIT MIT License |
| 23 | * @link https://graph.microsoft.com |
| 24 | */ |
| 25 | class Entity implements \JsonSerializable |
| 26 | { |
| 27 | /** |
| 28 | * The array of properties available |
| 29 | * to the model |
| 30 | * |
| 31 | * @var array $_propDict |
| 32 | */ |
| 33 | protected $_propDict; |
| 34 | |
| 35 | /** |
| 36 | * Construct a new Entity |
| 37 | * |
| 38 | * @param array $propDict A list of properties to set |
| 39 | */ |
| 40 | function __construct($propDict = array()) |
| 41 | { |
| 42 | if (!is_array($propDict)) { |
| 43 | $propDict = array(); |
| 44 | } |
| 45 | $this->_propDict = $propDict; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Gets the property dictionary of the Entity |
| 50 | * |
| 51 | * @return array The list of properties |
| 52 | */ |
| 53 | public function getProperties() |
| 54 | { |
| 55 | return $this->_propDict; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Gets the id |
| 60 | * Read-only. |
| 61 | * |
| 62 | * @return string|null The id |
| 63 | */ |
| 64 | public function getId() |
| 65 | { |
| 66 | if (array_key_exists("id", $this->_propDict)) { |
| 67 | return $this->_propDict["id"]; |
| 68 | } else { |
| 69 | return null; |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Sets the id |
| 75 | * Read-only. |
| 76 | * |
| 77 | * @param string $val The id |
| 78 | * |
| 79 | * @return Entity |
| 80 | */ |
| 81 | public function setId($val) |
| 82 | { |
| 83 | $this->_propDict["id"] = $val; |
| 84 | return $this; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Gets the ODataType |
| 89 | * |
| 90 | * @return string|null The ODataType |
| 91 | */ |
| 92 | public function getODataType() |
| 93 | { |
| 94 | if (array_key_exists('@odata.type', $this->_propDict)) { |
| 95 | return $this->_propDict["@odata.type"]; |
| 96 | } |
| 97 | return null; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Sets the ODataType |
| 102 | * |
| 103 | * @param string $val The ODataType |
| 104 | * |
| 105 | * @return Entity |
| 106 | */ |
| 107 | public function setODataType($val) |
| 108 | { |
| 109 | $this->_propDict["@odata.type"] = $val; |
| 110 | return $this; |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Serializes the object by property array |
| 115 | * Manually serialize DateTime into RFC3339 format |
| 116 | * |
| 117 | * @return array The list of properties |
| 118 | */ |
| 119 | #[\ReturnTypeWillChange] |
| 120 | public function jsonSerialize() |
| 121 | { |
| 122 | $serializableProperties = $this->getProperties(); |
| 123 | foreach ($serializableProperties as $property => $val) { |
| 124 | if (is_a($val, "\DateTime")) { |
| 125 | $serializableProperties[$property] = $val->format(\DateTime::RFC3339); |
| 126 | } else if (is_a($val, "\Microsoft\Graph\Core\Enum")) { |
| 127 | $serializableProperties[$property] = $val->value(); |
| 128 | } else if (is_a($val, "\Entity")) { |
| 129 | $serializableProperties[$property] = $val->jsonSerialize(); |
| 130 | } |
| 131 | } |
| 132 | return $serializableProperties; |
| 133 | } |
| 134 | } |
| 135 |