1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
syncsectionmap.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Sync\Entities;
4
5use Bitrix\Calendar\Core\Mappers\Section;
6use Bitrix\Calendar\Core;
7use Bitrix\Calendar\Sync\Dictionary;
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}
const SYNC_SECTION_ACTION
Определения dictionary.php:40
const SYNC_EVENT_ACTION
Определения dictionary.php:47