Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
nodeoptions.php
1<?
2
4
5class NodeOptions implements \JsonSerializable
6{
7 protected $itemOrder = [];
8 protected $open = false;
9 protected $dynamic = false;
10
11 public function __construct(array $options)
12 {
13 $this->setItemOrder($options['itemOrder'] ?? []);
14 $this->setOpen($options['open'] ?? false);
15 $this->setDynamic($options['dynamic'] ?? false);
16 }
17
18 public function setOpen(bool $open = true)
19 {
20 $this->open = $open;
21 }
22
23 public function isOpen()
24 {
25 return $this->open;
26 }
27
28 public function setDynamic(bool $dynamic = true)
29 {
30 $this->dynamic = $dynamic;
31 }
32
33 public function isDynamic()
34 {
35 return $this->dynamic;
36 }
37
38 public function setItemOrder(array $order)
39 {
40 $this->itemOrder = $order;
41 }
42
43 public function getItemOrder()
44 {
45 return $this->itemOrder;
46 }
47
48 public function jsonSerialize()
49 {
50 return [
51 'itemOrder' => $this->getItemOrder(),
52 'open' => $this->isOpen(),
53 'dynamic' => $this->isDynamic()
54 ];
55 }
56}