1: <?php
2: /**
3: * This code is licensed under AGPLv3 license or Afterlogic Software License
4: * if commercial version of the product was purchased.
5: * For full statements of the licenses see LICENSE-AFTERLOGIC and LICENSE-AGPL3 files.
6: */
7:
8: namespace Aurora\Modules\DavContacts;
9:
10: /**
11: * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0
12: * @license https://afterlogic.com/products/common-licensing Afterlogic Software License
13: * @copyright Copyright (c) 2023, Afterlogic Corp.
14: */
15: class Manager extends \Aurora\System\Managers\AbstractManagerWithStorage
16: {
17: /**
18: * Creates a new instance of the object.
19: *
20: * @param \Aurora\System\Module\AbstractModule $oModule
21: */
22: public function __construct(\Aurora\System\Module\AbstractModule $oModule = null)
23: {
24: parent::__construct($oModule, new Storages\Sabredav\Storage($this));
25: }
26:
27: /**
28: * Returns contact item identified by user ID and contact ID.
29: *
30: * @param int $iUserId
31: * @param mixed $mContactId
32: *
33: * @return \Aurora\Modules\Contacts\Classes\Contact|bool
34: */
35: public function getContactById($iUserId, $mContactId, $sAddressBookName = \Afterlogic\DAV\Constants::ADDRESSBOOK_DEFAULT_NAME)
36: {
37: $oContact = null;
38: try {
39: $oContact = $this->oStorage->getContactById($iUserId, $mContactId, $sAddressBookName);
40: if ($oContact) {
41: $mGroupIds = $this->getContactGroupIds($oContact);
42: if (is_array($mGroupIds)) {
43: $oContact->GroupIds = $mGroupIds;
44: }
45: }
46: } catch (\Aurora\System\Exceptions\BaseException $oException) {
47: $oContact = false;
48: $this->setLastException($oException);
49: }
50:
51: return $oContact;
52: }
53:
54: /**
55: * //TODO
56: *
57: * @param mixed $mTypeId
58: * @param int $iContactType
59: *
60: * @return \Aurora\Modules\Contacts\Classes\Contact|bool
61: */
62: public function GetContactByTypeId($mTypeId, $iContactType)
63: {
64: $oContact = null;
65: try {
66: $oContact = $this->oStorage->GetContactByTypeId($mTypeId, $iContactType);
67: if ($oContact) {
68: $mGroupIds = $this->getContactGroupIds($oContact);
69: if (is_array($mGroupIds)) {
70: $oContact->GroupIds = $mGroupIds;
71: }
72: }
73: } catch (\Aurora\System\Exceptions\BaseException $oException) {
74: $oContact = false;
75: $this->setLastException($oException);
76: }
77:
78: return $oContact;
79: }
80:
81: /**
82: * Returns contact item identified by email address.
83: *
84: * @param int $iUserId
85: * @param string $sEmail
86: *
87: * @return \Aurora\Modules\Contacts\Classes\Contact|bool
88: */
89: public function getContactByEmail($iUserId, $sEmail)
90: {
91: $oContact = null;
92: try {
93: $oContact = $this->oStorage->getContactByEmail($iUserId, $sEmail);
94: if ($oContact) {
95: $mGroupIds = $this->getContactGroupIds($oContact);
96: if (is_array($mGroupIds)) {
97: $oContact->GroupIds = $mGroupIds;
98: }
99: }
100: } catch (\Aurora\System\Exceptions\BaseException $oException) {
101: $oContact = false;
102: $this->setLastException($oException);
103: }
104:
105: return $oContact;
106: }
107:
108: /**
109: * Returns contact item identified by str_id value.
110: *
111: * @param int $iUserId
112: * @param string $sContactStrId
113: * @param int $iSharedTenantId. Default value is **null**
114: *
115: * @return \Aurora\Modules\Contacts\Classes\Contact
116: */
117: public function getContactByStrId($iUserId, $sContactStrId, $iSharedTenantId = null)
118: {
119: $oContact = null;
120: try {
121: $oContact = $this->oStorage->getContactByStrId($iUserId, $sContactStrId, $iSharedTenantId);
122: if ($oContact) {
123: $mGroupIds = $this->getContactGroupIds($oContact);
124: if (is_array($mGroupIds)) {
125: $oContact->GroupIds = $mGroupIds;
126: }
127: }
128: } catch (\Aurora\System\Exceptions\BaseException $oException) {
129: $oContact = false;
130: $this->setLastException($oException);
131: }
132:
133: return $oContact;
134: }
135:
136: /**
137: * Returns contact item identified by user ID and contact ID.
138: *
139: * @param int $iUserId
140: * @param mixed $mContactId
141: *
142: * @return resource | bool
143: */
144: public function getVCardObjectById($iUserId, $mContactId, $sAddressBookName = \Afterlogic\DAV\Constants::ADDRESSBOOK_DEFAULT_NAME)
145: {
146: $mResult = null;
147: try {
148: $oVCardObject = $this->oStorage->getVCardObjectById($iUserId, $mContactId, $sAddressBookName);
149: if ($oVCardObject) {
150: $mResult = $oVCardObject->get();
151: }
152: } catch (\Aurora\System\Exceptions\BaseException $oException) {
153: $mResult = false;
154: $this->setLastException($oException);
155: }
156:
157: return $mResult;
158: }
159:
160: /**
161: * Returns list of shared contacts by str_id value.
162: *
163: * @param int $iUserId
164: * @param int $iSharedTenantId Default value is **null**
165: *
166: * @return array|bool
167: */
168: public function getSharedContactIds($iUserId, $iSharedTenantId = null)
169: {
170: $aContactIds = array();
171: try {
172: $aContactIds = $this->oStorage->getSharedContactIds($iUserId, $iSharedTenantId);
173: } catch (\Aurora\System\Exceptions\BaseException $oException) {
174: $aContactIds = false;
175: $this->setLastException($oException);
176: }
177:
178: return $aContactIds;
179: }
180:
181: /**
182: * @param \Aurora\Modules\Contacts\Classes\Contact $oContact
183: *
184: * @return array|bool
185: */
186: public function getContactGroupIds($oContact)
187: {
188: $aGroupIds = false;
189: try {
190: $aGroupIds = $this->oStorage->getContactGroupIds($oContact);
191: } catch (\Aurora\System\Exceptions\BaseException $oException) {
192: $aGroupIds = false;
193: $this->setLastException($oException);
194: }
195:
196: return $aGroupIds;
197: }
198:
199: /**
200: * @param int $iUserId
201: * @param mixed $mGroupId
202: *
203: * @return \Aurora\Modules\Contacts\Classes\Group
204: */
205: public function getGroupById($iUserId, $mGroupId)
206: {
207: $oGroup = null;
208: try {
209: $oGroup = $this->oStorage->getGroupById($iUserId, $mGroupId);
210: } catch (\Aurora\System\Exceptions\BaseException $oException) {
211: $oGroup = false;
212: $this->setLastException($oException);
213: }
214:
215: return $oGroup;
216: }
217:
218: /**
219: * @param int $iUserId
220: * @param string $sGroupStrId
221: *
222: * @return \Aurora\Modules\Contacts\Classes\Group
223: */
224: public function getGroupByStrId($iUserId, $sGroupStrId)
225: {
226: $oGroup = null;
227: try {
228: $oGroup = $this->oStorage->getGroupByStrId($iUserId, $sGroupStrId);
229: } catch (\Aurora\System\Exceptions\BaseException $oException) {
230: $oGroup = false;
231: $this->setLastException($oException);
232: }
233:
234: return $oGroup;
235: }
236:
237: /**
238: * @param int $iUserId
239: * @param string $sName
240: *
241: * @return \Aurora\Modules\Contacts\Classes\Group
242: */
243: public function getGroupByName($iUserId, $sName)
244: {
245: $oGroup = null;
246: try {
247: $oGroup = $this->oStorage->getGroupByName($iUserId, $sName);
248: } catch (\Aurora\System\Exceptions\BaseException $oException) {
249: $oGroup = false;
250: $this->setLastException($oException);
251: }
252:
253: return $oGroup;
254: }
255:
256: /**
257: * @param \Aurora\Modules\Contacts\Classes\Contact $oContact
258: *
259: * @return bool
260: */
261: public function updateContact($oContact)
262: {
263: $bResult = false;
264: try {
265: if ($oContact->validate()) {
266: $bResult = $this->oStorage->updateContact($oContact);
267: }
268: } catch (\Aurora\System\Exceptions\BaseException $oException) {
269: $bResult = false;
270: $this->setLastException($oException);
271: }
272:
273: // TODO: a.ovcharov@gmail.com
274: // if ($bResult)
275: // {
276: // $oApiVoiceManager = /* @var $oApiVoiceManager \CApiVoiceManager */\Aurora\System\Api::Manager('voice');
277: // if ($oApiVoiceManager)
278: // {
279: // $oApiVoiceManager->flushCallersNumbersCache($oContact->IdUser);
280: // }
281: // }
282:
283: return $bResult;
284: }
285:
286: /**
287: * @param \Aurora\Modules\Contacts\Classes\Contact $oContact
288: * @param int $iUserId
289: *
290: * @return string
291: */
292: public function updateContactUserId($oContact, $iUserId)
293: {
294: $bResult = false;
295: try {
296: if ($oContact->validate()) {
297: $bResult = $this->oStorage->updateContactUserId($oContact, $iUserId);
298: }
299: } catch (\Aurora\System\Exceptions\BaseException $oException) {
300: $bResult = false;
301: $this->setLastException($oException);
302: }
303:
304: return $bResult;
305: }
306:
307: /**
308: * @param \Aurora\Modules\Contacts\Classes\Group $oGroup
309: * @return bool
310: */
311: public function updateGroup($oGroup)
312: {
313: $bResult = false;
314: try {
315: if ($oGroup->validate()) {
316: $bResult = $this->oStorage->updateGroup($oGroup);
317: }
318: } catch (\Aurora\System\Exceptions\BaseException $oException) {
319: $bResult = false;
320: $this->setLastException($oException);
321: }
322:
323: return $bResult;
324: }
325:
326: /**
327: * @param int $iUserId
328: * @param string $sSearch Default value is empty string
329: * @param string $sFirstCharacter Default value is empty string
330: * @param int $iGroupId Default value is **0**
331: * @param int $iTenantId Default value is **null**
332: * @param bool $bAll Default value is **false**
333: *
334: * @return int
335: */
336: public function getContactItemsCount($iUserId, $sSearch = '', $sFirstCharacter = '', $iGroupId = 0, $iTenantId = null, $bAll = false)
337: {
338: $iResult = 0;
339: try {
340: $iResult = $this->oStorage->getContactItemsCount($iUserId, $sSearch, $sFirstCharacter, $iGroupId, $iTenantId, $bAll);
341: } catch (\Aurora\System\Exceptions\BaseException $oException) {
342: $iResult = 0;
343: $this->setLastException($oException);
344: }
345:
346: return $iResult;
347: }
348:
349: /**
350: * @param int $iUserId
351: * @param int $iOffset Default value is **0**
352: * @param int $iRequestLimit Default value is **20**
353: *
354: * @return bool|array
355: */
356: public function getContactItemsWithoutOrder($iUserId, $iOffset = 0, $iRequestLimit = 20)
357: {
358: $mResult = false;
359: try {
360: $mResult = $this->oStorage->getContactItemsWithoutOrder($iUserId, $iOffset, $iRequestLimit);
361: } catch (\Aurora\System\Exceptions\BaseException $oException) {
362: $mResult = false;
363: $this->setLastException($oException);
364: }
365:
366: return $mResult;
367: }
368:
369: /**
370: *
371: * @param int $iSortField
372: * @param int $iSortOrder
373: * @param int $iOffset
374: * @param int $iRequestLimit
375: * @param array $aFilters
376: * @param int $iIdGroup
377: * @return boolean
378: */
379: public function getContactItems(
380: $iSortField = \Aurora\Modules\Contacts\Enums\SortField::Email,
381: $iSortOrder = \Aurora\System\Enums\SortOrder::ASC,
382: $iOffset = 0,
383: $iRequestLimit = 20,
384: $aFilters = array(),
385: $iIdGroup = 0
386: )
387: {
388: $mResult = false;
389: try {
390: $mResult = $this->oStorage->getContactItems($iSortField, $iSortOrder, $iOffset, $iRequestLimit, $aFilters, $iIdGroup);
391: } catch (\Aurora\System\Exceptions\BaseException $oException) {
392: $mResult = false;
393: $this->setLastException($oException);
394: }
395:
396: return $mResult;
397: }
398:
399: /**
400: * @param string $mUserId
401: *
402: * @return bool|array
403: */
404: public function GetContactItemObjects($mUserId)
405: {
406: $mResult = false;
407: try {
408: $mResult = $this->oStorage->GetContactItemObjects($mUserId);
409: } catch (\Aurora\System\Exceptions\BaseException $oException) {
410: $mResult = false;
411: $this->setLastException($oException);
412: }
413:
414: return $mResult;
415: }
416:
417: /**
418: * @param int $iUserId
419: *
420: * @return \Aurora\Modules\Contacts\Classes\Contact|null
421: */
422: public function GetMyGlobalContact($iUserId)
423: {
424: return $this->oStorage->GetMyGlobalContact($iUserId);
425: }
426:
427: /**
428: * @param int $iUserId
429: * @param string $sSearch Default value is empty string
430: * @param string $sFirstCharacter Default value is empty string
431: *
432: * @return int
433: */
434: public function getGroupItemsCount($iUserId, $sSearch = '', $sFirstCharacter = '')
435: {
436: $iResult = 0;
437: try {
438: $iResult = $this->oStorage->getGroupItemsCount($iUserId, $sSearch, $sFirstCharacter);
439: } catch (\Aurora\System\Exceptions\BaseException $oException) {
440: $iResult = 0;
441: $this->setLastException($oException);
442: }
443:
444: return $iResult;
445: }
446:
447: /**
448: * @param int $iUserId
449: * @param int $iSortField Default value is **\Aurora\Modules\Contacts\Enums\SortField::Name 1**,
450: * @param int $iSortOrder Default value is **\Aurora\System\Enums\SortOrder::ASC 0**,
451: * @param int $iOffset Default value is **0**
452: * @param int $iRequestLimit Default value is **20**
453: * @param string $sSearch Default value is empty string
454: * @param string $sFirstCharacter Default value is empty string
455: * @param int $iContactId Default value is **0**
456: *
457: * @return bool|array
458: */
459: public function getGroupItems(
460: $iUserId,
461: $iSortField = \Aurora\Modules\Contacts\Enums\SortField::Name,
462: $iSortOrder = \Aurora\System\Enums\SortOrder::ASC,
463: $iOffset = 0,
464: $iRequestLimit = 20,
465: $sSearch = '',
466: $sFirstCharacter = '',
467: $iContactId = 0
468: )
469: {
470: $mResult = false;
471: try {
472: $mResult = $this->oStorage->getGroupItems(
473: $iUserId,
474: $iSortField,
475: $iSortOrder,
476: $iOffset,
477: $iRequestLimit,
478: $sSearch,
479: $sFirstCharacter,
480: $iContactId
481: );
482: } catch (\Aurora\System\Exceptions\BaseException $oException) {
483: $mResult = false;
484: $this->setLastException($oException);
485: }
486:
487: return $mResult;
488: }
489:
490: /**
491: * @param \Aurora\Modules\StandardAuth\Classes\Account $oAccount
492: *
493: * @return bool|array
494: */
495: public function GetAllContactsNamesWithPhones($oAccount)
496: {
497: $mResult = false;
498: try {
499: $mResult = array(); // TODO
500: } catch (\Aurora\System\Exceptions\BaseException $oException) {
501: $mResult = false;
502: $this->setLastException($oException);
503: }
504:
505: return $mResult;
506: }
507:
508: /**
509: * @param \Aurora\Modules\Contacts\Classes\Contact $oContact
510: *
511: * @return bool
512: */
513: public function createContact($oContact)
514: {
515: $bResult = false;
516: try {
517: if ($oContact->validate()) {
518: $bResult = $this->oStorage->createContact($oContact);
519: }
520: } catch (\Aurora\System\Exceptions\BaseException $oException) {
521: $bResult = false;
522: $this->setLastException($oException);
523: }
524:
525: if ($bResult) {
526: // $oApiVoiceManager = /* @var $oApiVoiceManager \CApiVoiceManager */\Aurora\System\Api::Manager('voice');
527: // if ($oApiVoiceManager)
528: // {
529: // $oApiVoiceManager->flushCallersNumbersCache($oContact->IdUser);
530: // }
531: }
532:
533: return $bResult;
534: }
535:
536: public function copyContact($iUserId, $sUID, $sFromAddressbook, $sToAddressbook)
537: {
538: $mResult = false;
539: try {
540: $mResult = $this->oStorage->copyContact($iUserId, $sUID, $sFromAddressbook, $sToAddressbook);
541: } catch (\Aurora\System\Exceptions\BaseException $oException) {
542: $mResult = false;
543: $this->setLastException($oException);
544: }
545:
546: return $mResult;
547: }
548:
549: /**
550: * @param \Aurora\Modules\Contacts\Classes\Group $oGroup
551: *
552: * @return bool
553: */
554: public function createGroup($oGroup)
555: {
556: $bResult = false;
557: try {
558: if ($oGroup->validate()) {
559: $bResult = $this->oStorage->createGroup($oGroup);
560: }
561: } catch (\Aurora\System\Exceptions\BaseException $oException) {
562: $bResult = false;
563: $this->setLastException($oException);
564: }
565: return $bResult;
566: }
567:
568: /**
569: * @param int $iUserId
570: * @param array $aContactIds
571: *
572: * @return bool
573: */
574: public function deleteContacts($iUserId, $aContactIds, $sAddressBook = \Afterlogic\DAV\Constants::ADDRESSBOOK_DEFAULT_NAME)
575: {
576: $bResult = false;
577: try {
578: $bResult = $this->oStorage->deleteContacts($iUserId, $aContactIds, $sAddressBook);
579: } catch (\Aurora\System\Exceptions\BaseException $oException) {
580: $bResult = false;
581: $this->setLastException($oException);
582: }
583:
584: if ($bResult) {
585: // $oApiVoiceManager = /* @var $oApiVoiceManager \CApiVoiceManager */\Aurora\System\Api::Manager('voice');
586: // if ($oApiVoiceManager)
587: // {
588: // $oApiVoiceManager->flushCallersNumbersCache($iUserId);
589: // }
590: }
591:
592: return $bResult;
593: }
594:
595: /**
596: * @param int $iUserId
597: * @param array $aContactIds
598: *
599: * @return bool
600: */
601: public function deleteSuggestContacts($iUserId, $aContactIds)
602: {
603: $bResult = false;
604: try {
605: $bResult = $this->oStorage->deleteSuggestContacts($iUserId, $aContactIds);
606: } catch (\Aurora\System\Exceptions\BaseException $oException) {
607: $bResult = false;
608: $this->setLastException($oException);
609: }
610: return $bResult;
611: }
612:
613: /**
614: * @param int $iUserId
615: * @param array $aGroupIds
616: *
617: * @return bool
618: */
619: public function deleteGroups($iUserId, $aGroupIds)
620: {
621: $bResult = false;
622: try {
623: $bResult = $this->oStorage->deleteGroups($iUserId, $aGroupIds);
624: } catch (\Aurora\System\Exceptions\BaseException $oException) {
625: $bResult = false;
626: $this->setLastException($oException);
627: }
628: return $bResult;
629: }
630:
631: /**
632: * @param int $iUserId
633: * @param mixed $mGroupId
634: *
635: * @return bool
636: */
637: public function deleteGroup($iUserId, $mGroupId)
638: {
639: $bResult = false;
640: try {
641: $bResult = $this->oStorage->deleteGroup($iUserId, $mGroupId);
642: } catch (\Aurora\System\Exceptions\BaseException $oException) {
643: $bResult = false;
644: $this->setLastException($oException);
645: }
646: return $bResult;
647: }
648:
649: /**
650: * @param int $iUserId
651: * @param array $aEmails
652: *
653: * @return bool
654: */
655: public function updateSuggestTable($iUserId, $aEmails)
656: {
657: $bResult = false;
658: try {
659: $bResult = $this->oStorage->updateSuggestTable($iUserId, $aEmails);
660: } catch (\Aurora\System\Exceptions\BaseException $oException) {
661: $bResult = false;
662: $this->setLastException($oException);
663: }
664: return $bResult;
665: }
666:
667: /**
668: * @param int $iUserId
669: *
670: * @return bool
671: */
672: public function clearAllContactsAndGroups($iUserId)
673: {
674: $bResult = $this->oStorage->clearAllContactsAndGroups($iUserId);
675:
676: return $bResult;
677: }
678:
679: /**
680: * @return bool
681: */
682: public function flushContacts()
683: {
684: $bResult = false;
685: try {
686: $bResult = $this->oStorage->flushContacts();
687: } catch (\Aurora\System\Exceptions\BaseException $oException) {
688: $bResult = false;
689: $this->setLastException($oException);
690: }
691: return $bResult;
692: }
693:
694: /**
695: * @param \Aurora\Modules\Contacts\Classes\Group $oGroup
696: * @param array $aContactIds
697: *
698: * @return bool
699: */
700: public function addContactsToGroup($oGroup, $aContactIds)
701: {
702: $bResult = false;
703: try {
704: $bResult = $this->oStorage->addContactsToGroup($oGroup, $aContactIds);
705: } catch (\Aurora\System\Exceptions\BaseException $oException) {
706: $bResult = false;
707: $this->setLastException($oException);
708: }
709: return $bResult;
710: }
711:
712: /**
713: * @param \Aurora\Modules\Contacts\Classes\Group $oGroup
714: * @param array $aContactIds
715: *
716: * @return bool
717: */
718: public function removeContactsFromGroup($oGroup, $aContactIds)
719: {
720: $bResult = false;
721: try {
722: $bResult = $this->oStorage->removeContactsFromGroup($oGroup, $aContactIds);
723: } catch (\Aurora\System\Exceptions\BaseException $oException) {
724: $bResult = false;
725: $this->setLastException($oException);
726: }
727: return $bResult;
728: }
729:
730: /**
731: * @param \Aurora\Modules\StandardAuth\Classes\Account $oAccount
732: * @param mixed $mContactId
733: * @param string $sStorage
734: *
735: * @return mixed
736: */
737: public function ConvertedContactLocalId($oAccount, $mContactId, $sStorage = 'global')
738: {
739: $mResult = null;
740: try {
741: $mResult = $this->oStorage->ConvertedContactLocalId($oAccount, $mContactId, $sStorage);
742: } catch (\Aurora\System\Exceptions\BaseException $oException) {
743: $this->setLastException($oException);
744: }
745: return $mResult;
746: }
747:
748: /**
749: * @param \Aurora\Modules\StandardAuth\Classes\Account $oAccount
750: * @param string $sStorage
751: *
752: * @return mixed
753: */
754: public function ConvertedContactLocalIdCollection($oAccount, $sStorage = 'global')
755: {
756: $aResult = array();
757: try {
758: $aResult = $this->oStorage->ConvertedContactLocalIdCollection($oAccount, $sStorage);
759: } catch (\Aurora\System\Exceptions\BaseException $oException) {
760: $this->setLastException($oException);
761: }
762: return $aResult;
763: }
764:
765: /**
766: * @param array $aIds
767: *
768: * @return mixed
769: */
770: public function ContactIdsLinkedToGroups($aIds)
771: {
772: $aResult = array();
773: try {
774: $aResult = $this->oStorage->ContactIdsLinkedToGroups($aIds);
775: } catch (\Aurora\System\Exceptions\BaseException $oException) {
776: $this->setLastException($oException);
777: }
778: return $aResult;
779: }
780:
781: /**
782: * @param int $iUserId
783: * @param mixed $mContactId
784: *
785: * @return \Aurora\Modules\Contacts\Classes\Contact|bool
786: */
787: public function GetGlobalContactById($iUserId, $mContactId)
788: {
789: $oContact = null;
790: try {
791: $oContact = $this->oStorage->GetGlobalContactById($iUserId, $mContactId);
792: if ($oContact) {
793: $mGroupIds = $this->getContactGroupIds($oContact);
794: if (is_array($mGroupIds)) {
795: $oContact->GroupIds = $mGroupIds;
796: }
797: }
798: } catch (\Aurora\System\Exceptions\BaseException $oException) {
799: $oContact = false;
800: $this->setLastException($oException);
801: }
802:
803: return $oContact;
804: }
805:
806: /**
807: * @param int $iGroupId
808: *
809: * @return bool
810: */
811: public function getGroupEvents($iGroupId)
812: {
813: $bResult = false;
814: try {
815: $bResult = $this->oStorage->getGroupEvents($iGroupId);
816: } catch (\Aurora\System\Exceptions\BaseException $oException) {
817: $bResult = false;
818: $this->setLastException($oException);
819: }
820: return $bResult;
821: }
822:
823: /**
824: * @param string $sCalendarId
825: * @param string $sEventId
826: *
827: * @return bool
828: */
829: public function getGroupEvent($sCalendarId, $sEventId)
830: {
831: $bResult = false;
832: try {
833: $bResult = $this->oStorage->getGroupEvent($sCalendarId, $sEventId);
834: } catch (\Aurora\System\Exceptions\BaseException $oException) {
835: $bResult = false;
836: $this->setLastException($oException);
837: }
838: return $bResult;
839: }
840:
841: /**
842: * @param int $iGroupId
843: * @param string $sCalendarId
844: * @param string $sEventId
845: *
846: * @return bool
847: */
848: public function addEventToGroup($iGroupId, $sCalendarId, $sEventId)
849: {
850: $bResult = false;
851: try {
852: $bResult = $this->oStorage->addEventToGroup($iGroupId, $sCalendarId, $sEventId);
853: } catch (\Aurora\System\Exceptions\BaseException $oException) {
854: $bResult = false;
855: $this->setLastException($oException);
856: }
857: return $bResult;
858: }
859:
860: /**
861: * @param int $iGroupId
862: * @param string $sCalendarId
863: * @param string $sEventId
864: *
865: * @return bool
866: */
867: public function removeEventFromGroup($iGroupId, $sCalendarId, $sEventId)
868: {
869: $bResult = false;
870: try {
871: $bResult = $this->oStorage->removeEventFromGroup($iGroupId, $sCalendarId, $sEventId);
872: } catch (\Aurora\System\Exceptions\BaseException $oException) {
873: $bResult = false;
874: $this->setLastException($oException);
875: }
876: return $bResult;
877: }
878:
879: /**
880: * @param string $sCalendarId
881: * @param string $sEventId
882: *
883: * @return bool
884: */
885: public function removeEventFromAllGroups($sCalendarId, $sEventId)
886: {
887: $bResult = false;
888: try {
889: $bResult = $this->oStorage->removeEventFromAllGroups($sCalendarId, $sEventId);
890: } catch (\Aurora\System\Exceptions\BaseException $oException) {
891: $bResult = false;
892: $this->setLastException($oException);
893: }
894: return $bResult;
895: }
896:
897: public function getAddressBook($iUserId, $sUri)
898: {
899: $mResult = false;
900: try {
901: $mResult = $this->oStorage->getAddressBook($iUserId, $sUri);
902: } catch (\Aurora\System\Exceptions\BaseException $oException) {
903: $mResult = false;
904: $this->setLastException($oException);
905: }
906: return $mResult;
907: }
908:
909: public function createAddressBook($iUserId, $sUri, $sName)
910: {
911: $bResult = false;
912: try {
913: $bResult = $this->oStorage->createAddressBook($iUserId, $sUri, $sName);
914: } catch (\Aurora\System\Exceptions\BaseException $oException) {
915: $bResult = false;
916: $this->setLastException($oException);
917: }
918: return $bResult;
919: }
920:
921: public function updateAddressBook($iUserId, $sName, $sNewName)
922: {
923: $bResult = false;
924: try {
925: $bResult = $this->oStorage->updateAddressBook($iUserId, $sName, $sNewName);
926: } catch (\Aurora\System\Exceptions\BaseException $oException) {
927: $bResult = false;
928: $this->setLastException($oException);
929: }
930: return $bResult;
931: }
932:
933: public function deleteAddressBook($iUserId, $sName)
934: {
935: $bResult = false;
936: try {
937: $bResult = $this->oStorage->deleteAddressBook($iUserId, $sName);
938: } catch (\Aurora\System\Exceptions\BaseException $oException) {
939: $bResult = false;
940: $this->setLastException($oException);
941: }
942: return $bResult;
943: }
944: }
945: