Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
context.php
1<?php
2
4
6use Bitrix\Calendar\Core;
7
18{
22 private array $data;
23
24 public function __construct(array $data = [])
25 {
26 $this->data = $data;
27 }
28
29 public function __get($name)
30 {
31 return $this->data[$name] ?? null;
32 }
33
34 public function __set($name, $value)
35 {
36 $this->data[$name] = $value;
37 }
38
39 public function __isset($name)
40 {
41 return isset($this->data[$name]);
42 }
43
53 public function add(string $type, string $property, $value): Context
54 {
55 $this->data[$type][$property] = $value;
56
57 return $this;
58 }
59
66 public function merge(Context $context): Context
67 {
68 $this->data = array_merge($this->data, $context->data);
69
70 return $this;
71 }
72
78 public function getByKey(string $key)
79 {
80 if (isset($this->data[$key]))
81 {
82 return null;
83 }
84
85 return $this->data[$key];
86 }
87}
add(string $type, string $property, $value)
Definition context.php:53