@@ 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 |
@@ 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 |
@@ 410-424 (lines=15) @@ | ||
407 | * @param array $options |
|
408 | * @return Type |
|
409 | */ |
|
410 | public function getItem($itemId, $options = array()) |
|
411 | { |
|
412 | if ($itemId instanceof Type\ItemIdType) { |
|
413 | $itemId = $itemId->toArray(); |
|
414 | } |
|
415 | ||
416 | $request = array( |
|
417 | 'ItemShape' => array('BaseShape' => 'AllProperties'), |
|
418 | 'ItemIds' => array('ItemId' => $itemId) |
|
419 | ); |
|
420 | ||
421 | $request = array_replace_recursive($request, $options); |
|
422 | ||
423 | return $this->getClient()->GetItem($request); |
|
424 | } |
|
425 | ||
426 | /** |
|
427 | * Get a list of sync changes on a folder |