1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
instancemap.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Sync\Entities;
4
5use Bitrix\Calendar\Core\Base\Date;
6use Bitrix\Calendar\Core\Base\Map;
7
8class InstanceMap extends Map
9{
10 public const DATE_FORMAT_FOR_KEY = 'Ymd';
11
16 public static function getKeyByDate(Date $originalDate): string
17 {
18 return $originalDate->format(self::DATE_FORMAT_FOR_KEY);
19 }
20
27 public function add($item, $key = null): self
28 {
30 if ($key === null)
31 {
32 if ($date = $item->getEvent()->getOriginalDateFrom())
33 {
34 $key = self::getKeyByDate($date);
35 }
36 else
37 {
38 $key = self::getKeyByDate($item->getEvent()->getStart());
39 }
40 }
41
42 parent::add($item, $key);
43
44 return $this;
45 }
46
50 public function addItems(array $items): self
51 {
52 foreach ($items as $item)
53 {
54 $this->add($item);
55 }
56
57 return $this;
58 }
59}
add($item, $key=null)
Определения map.php:20
static getKeyByDate(Date $originalDate)
Определения instancemap.php:16
Определения date.php:9
format($format)
Определения date.php:110
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if(empty($signedUserToken)) $key
Определения quickway.php:257
$items
Определения template.php:224