Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
jscode.php
1<?php
2
3namespace Bitrix\UI\Buttons;
4
5final class JsCode implements \JsonSerializable
6{
10 private $code;
11
16 public function __construct($code)
17 {
18 $this->setCode($code);
19 }
20
24 public function getCode()
25 {
26 return $this->code;
27 }
28
34 public function setCode($code)
35 {
36 if (is_string($code))
37 {
38 $this->code = $code;
39 }
40
41 return $this;
42 }
43
51 public function jsonSerialize()
52 {
53 return [
54 'code' => $this->getCode(),
55 ];
56 }
57}