Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
syncsectionmap.php
1<?php
2
4
6use Bitrix\Calendar\Core;
8
10{
11 public function getNonLocalSections(): SyncSectionMap
12 {
13 return new self(array_filter($this->collection, function ($item) {
15 return $item->getVendorName() !== Section::SECTION_TYPE_LOCAL;
16 }));
17 }
18
19 public function getLocalSections(): SyncSectionMap
20 {
21 return new self(array_filter($this->collection, function ($item) {
23 return $item->getVendorName() === Section::SECTION_TYPE_LOCAL;
24 }));
25 }
26
30 public function getSuccessSyncSection(): SyncSectionMap
31 {
32 return new self(array_filter($this->collection, function ($syncSection) {
34 return $syncSection->getAction() === Dictionary::SYNC_SECTION_ACTION['success'];
35 }));
36 }
37
41 public function getActiveSections()
42 {
43 return new static(array_filter(
44 $this->collection,
45 static fn ($item) => ($item->getAction() !== Dictionary::SYNC_EVENT_ACTION['delete']))
46 );
47 }
48}