| @@ 159-180 (lines=22) @@ | ||
| 156 | * @param $changes |
|
| 157 | * @return Type\CalendarItemType[] |
|
| 158 | */ |
|
| 159 | public function updateCalendarItem(Type\ItemIdType $itemId, $changes) |
|
| 160 | { |
|
| 161 | //Create the request |
|
| 162 | $request = array( |
|
| 163 | 'ItemChange' => array( |
|
| 164 | 'ItemId' => $itemId->toArray(), |
|
| 165 | 'Updates' => $this->buildUpdateItemChanges('CalendarItem', 'calendar', $changes) |
|
| 166 | ) |
|
| 167 | ); |
|
| 168 | ||
| 169 | $options = array( |
|
| 170 | 'SendMeetingInvitationsOrCancellations' => 'SendToNone' |
|
| 171 | ); |
|
| 172 | ||
| 173 | $items = $this->updateItems($request, $options)->getCalendarItem(); |
|
| 174 | ||
| 175 | if (!is_array($items)) { |
|
| 176 | $items = array($items); |
|
| 177 | } |
|
| 178 | ||
| 179 | return $items; |
|
| 180 | } |
|
| 181 | ||
| 182 | /** |
|
| 183 | * @param $itemId Type\ItemIdType |
|
| @@ 77-94 (lines=18) @@ | ||
| 74 | * @param array $options |
|
| 75 | * @return Type\ItemIdType[] |
|
| 76 | */ |
|
| 77 | public function createContacts($contacts, $options = array()) |
|
| 78 | { |
|
| 79 | $request = array('Contact' => $contacts); |
|
| 80 | ||
| 81 | $defaultOptions = array( |
|
| 82 | 'MessageDisposition' => 'SaveOnly', |
|
| 83 | 'SavedItemFolderId' => array('FolderId' => $this->getFolderId()->toArray()) |
|
| 84 | ); |
|
| 85 | $options = array_replace_recursive($defaultOptions, $options); |
|
| 86 | ||
| 87 | $result = $this->createItems($request, $options); |
|
| 88 | ||
| 89 | if (!is_array($result)) { |
|
| 90 | $result = array($result); |
|
| 91 | } |
|
| 92 | ||
| 93 | return $result; |
|
| 94 | } |
|
| 95 | ||
| 96 | public function updateContactItem(Type\ItemIdType $itemId, $changes) |
|
| 97 | { |
|
| @@ 96-115 (lines=20) @@ | ||
| 93 | return $result; |
|
| 94 | } |
|
| 95 | ||
| 96 | public function updateContactItem(Type\ItemIdType $itemId, $changes) |
|
| 97 | { |
|
| 98 | //Create the request |
|
| 99 | $request = array( |
|
| 100 | 'ItemChange' => array( |
|
| 101 | 'ItemId' => $itemId->toArray(), |
|
| 102 | 'Updates' => $this->buildUpdateItemChanges('Contact', 'contacts', $changes) |
|
| 103 | ) |
|
| 104 | ); |
|
| 105 | ||
| 106 | $options = array(); |
|
| 107 | ||
| 108 | $items = $this->updateItems($request, $options); |
|
| 109 | ||
| 110 | if (!is_array($items)) { |
|
| 111 | $items = array($items); |
|
| 112 | } |
|
| 113 | ||
| 114 | return $items; |
|
| 115 | } |
|
| 116 | } |
|
| 117 | ||
| @@ 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 |
|
| @@ 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 |
|