1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
modificationfieldsbase.php
См. документацию.
1<?php
2
3namespace Bitrix\Sale\Rest;
4
5use Bitrix\Main\Engine\Action;
6use Bitrix\Main\Engine\Controller;
7use Bitrix\Rest\RestException;
8
10{
11 const TO_WHITE_LIST = 'TO_WHITE_LIST';
12 const TO_CAMEL = 'TO_CAMEL';
13 const TO_SNAKE = 'TO_SNAKE';
14 const SORTING_KEYS = 'SORTING_KEYS';
15 const CHECK_REQUIRED = 'CHECK_REQUIRED';
16
17 protected string $name;
18 protected array $arguments;
20 protected $format;
21 protected $data;
22 protected $scope;
23
24 static public function buildByAction(Action $action, $data=[], $scope='')
25 {
26 return new static($action->getName(), $action->getArguments(), $action->getController(), $data, $scope);
27 }
28
30 {
31 $this->name = $name;
32 $this->arguments = $arguments;
33 $this->controller = $controller;
34
35 $this->data = $data;
36 $this->scope = $scope;
37 }
38
39 public function getName()
40 {
41 return $this->name;
42 }
43
44 public function getArguments()
45 {
46 return $this->arguments;
47 }
48
49 public function setArguments($arguments)
50 {
51 $this->arguments = $arguments;
52 }
53
57 public function setFormat($format): void
58 {
59 $this->format = $format;
60 }
61
62 public function getController()
63 {
64 return $this->controller;
65 }
66
67 public function getScope()
68 {
69 return $this->scope;
70 }
71
72 public function getData()
73 {
74 return $this->data;
75 }
76
82 protected function getEntity(Controller $controller)
83 {
84 $entity = null;
85 if($controller instanceof \Bitrix\Sale\Controller\Order)
86 {
87 $entity = new \Bitrix\Sale\Rest\Entity\Order();
88 }
90 {
91 $entity = new \Bitrix\Sale\Rest\Entity\BasketItem();
92 }
93 elseif ($controller instanceof \Bitrix\Sale\Controller\BasketProperties)
94 {
95 $entity = new \Bitrix\Sale\Rest\Entity\BasketProperties();
96 }
98 {
99 $entity = new \Bitrix\Sale\Rest\Entity\Payment();
100 }
101 elseif ($controller instanceof \Bitrix\Sale\Controller\Property)
102 {
103 $entity = new \Bitrix\Sale\Rest\Entity\Property();
104 }
106 {
107 $entity = new \Bitrix\Sale\Rest\Entity\Shipment();
108 }
110 {
111 $entity = new \Bitrix\Sale\Rest\Entity\ShipmentItem();
112 }
113 else
114 {
115 throw new RestException('Unknown object ' . get_class($controller));
116 }
117
118 return $entity;
119 }
120}
Определения payment.php:19
__construct($name, $arguments, $controller, $data=[], $scope='')
Определения modificationfieldsbase.php:29
getEntity(Controller $controller)
Определения modificationfieldsbase.php:82
static buildByAction(Action $action, $data=[], $scope='')
Определения modificationfieldsbase.php:24
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$entity
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
$action
Определения file_dialog.php:21