1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
requestentity.php
См. документацию.
1<?php
2
3namespace Sale\Handlers\Delivery\YandexTaxi\Api\RequestEntity;
4
5use Bitrix\Main\Text\Encoding;
6
12abstract class RequestEntity implements \JsonSerializable
13{
15 private $options = [];
16
20 public function jsonSerialize(): array
21 {
22 $result = [];
23
24 $vars = get_object_vars($this);
25
26 foreach ($vars as $name => $value)
27 {
28 if ($name === 'options')
29 {
30 continue;
31 }
32
33 if (is_null($value))
34 {
35 continue;
36 }
37
38 $result[$this->castToUnderscore($name)] = $value;
39 }
40
41 foreach ($this->options as $optionCode => $optionValue)
42 {
43 $result[$optionCode] = $optionValue;
44 }
45
46 return $result;
47 }
48
53 protected function castToUnderscore(string $name)
54 {
55 return strtolower(preg_replace('/([^A-Z])([A-Z])/', "$1_$2", $name));
56 }
57
62 public function setOptions(array $options): RequestEntity
63 {
64 $this->options = $options;
65
66 return $this;
67 }
68}
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$name
Определения menu_edit.php:35
$value
Определения Param.php:39
$optionValue
Определения options.php:3512