| @@ 411-425 (lines=15) @@ | ||
| 408 | * @param array $options |
|
| 409 | * @return Type |
|
| 410 | */ |
|
| 411 | public function getItem($itemId, $options = array()) |
|
| 412 | { |
|
| 413 | if ($itemId instanceof Type\ItemIdType) { |
|
| 414 | $itemId = $itemId->toArray(); |
|
| 415 | } |
|
| 416 | ||
| 417 | $request = array( |
|
| 418 | 'ItemShape' => array('BaseShape' => 'AllProperties'), |
|
| 419 | 'ItemIds' => array('ItemId' => $itemId) |
|
| 420 | ); |
|
| 421 | ||
| 422 | $request = array_replace_recursive($request, $options); |
|
| 423 | ||
| 424 | return $this->getClient()->GetItem($request); |
|
| 425 | } |
|
| 426 | ||
| 427 | /** |
|
| 428 | * Get a list of sync changes on a folder |
|
| @@ 160-181 (lines=22) @@ | ||
| 157 | * @param $changes |
|
| 158 | * @return Type\CalendarItemType[] |
|
| 159 | */ |
|
| 160 | public function updateCalendarItem(Type\ItemIdType $itemId, $changes) |
|
| 161 | { |
|
| 162 | //Create the request |
|
| 163 | $request = array( |
|
| 164 | 'ItemChange' => array( |
|
| 165 | 'ItemId' => $itemId->toArray(), |
|
| 166 | 'Updates' => $this->buildUpdateItemChanges('CalendarItem', 'calendar', $changes) |
|
| 167 | ) |
|
| 168 | ); |
|
| 169 | ||
| 170 | $options = array( |
|
| 171 | 'SendMeetingInvitationsOrCancellations' => 'SendToNone' |
|
| 172 | ); |
|
| 173 | ||
| 174 | $items = $this->updateItems($request, $options)->getCalendarItem(); |
|
| 175 | ||
| 176 | if (!is_array($items)) { |
|
| 177 | $items = array($items); |
|
| 178 | } |
|
| 179 | ||
| 180 | return $items; |
|
| 181 | } |
|
| 182 | ||
| 183 | /** |
|
| 184 | * @param Type\ItemIdType $itemId |
|
| @@ 76-93 (lines=18) @@ | ||
| 73 | * @param array $options |
|
| 74 | * @return Type\ItemIdType[] |
|
| 75 | */ |
|
| 76 | public function createContacts($contacts, $options = array()) |
|
| 77 | { |
|
| 78 | $request = array('Contact' => $contacts); |
|
| 79 | ||
| 80 | $defaultOptions = array( |
|
| 81 | 'MessageDisposition' => 'SaveOnly', |
|
| 82 | 'SavedItemFolderId' => array('FolderId' => $this->getFolderId()->toArray()) |
|
| 83 | ); |
|
| 84 | $options = array_replace_recursive($defaultOptions, $options); |
|
| 85 | ||
| 86 | $result = $this->createItems($request, $options); |
|
| 87 | ||
| 88 | if (!is_array($result)) { |
|
| 89 | $result = array($result); |
|
| 90 | } |
|
| 91 | ||
| 92 | return $result; |
|
| 93 | } |
|
| 94 | ||
| 95 | public function updateContactItem(Type\ItemIdType $itemId, $changes) |
|
| 96 | { |
|
| @@ 95-114 (lines=20) @@ | ||
| 92 | return $result; |
|
| 93 | } |
|
| 94 | ||
| 95 | public function updateContactItem(Type\ItemIdType $itemId, $changes) |
|
| 96 | { |
|
| 97 | //Create the request |
|
| 98 | $request = array( |
|
| 99 | 'ItemChange' => array( |
|
| 100 | 'ItemId' => $itemId->toArray(), |
|
| 101 | 'Updates' => $this->buildUpdateItemChanges('Contact', 'contacts', $changes) |
|
| 102 | ) |
|
| 103 | ); |
|
| 104 | ||
| 105 | $options = array(); |
|
| 106 | ||
| 107 | $items = $this->updateItems($request, $options); |
|
| 108 | ||
| 109 | if (!is_array($items)) { |
|
| 110 | $items = array($items); |
|
| 111 | } |
|
| 112 | ||
| 113 | return $items; |
|
| 114 | } |
|
| 115 | } |
|
| 116 | ||
| @@ 131-148 (lines=18) @@ | ||
| 128 | * @param $changes |
|
| 129 | * @return Type\MessageType[] |
|
| 130 | */ |
|
| 131 | public function updateMailItem($itemId, $changes) |
|
| 132 | { |
|
| 133 | //Create the request |
|
| 134 | $request = array( |
|
| 135 | 'ItemChange' => array( |
|
| 136 | 'ItemId' => $itemId->toArray(), |
|
| 137 | 'Updates' => $this->buildUpdateItemChanges('Message', 'message', $changes) |
|
| 138 | ) |
|
| 139 | ); |
|
| 140 | ||
| 141 | $items = $this->updateItems($request); |
|
| 142 | ||
| 143 | if (!is_array($items)) { |
|
| 144 | $items = array($items); |
|
| 145 | } |
|
| 146 | ||
| 147 | return $items; |
|
| 148 | } |
|
| 149 | ||
| 150 | /** |
|
| 151 | * @param $mailItem Type\MessageType|Type\ItemIdType |
|