1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
statisticprovider.php
См. документацию.
1<?php
2
3
4namespace Bitrix\Sale\Exchange\Integration\Controller;
5
6
7use Bitrix\Main\Engine\Action;
8use Bitrix\Main\Error;
9use Bitrix\Rest\Integration\Controller\Base;
10use Bitrix\Sale\Rest\View\SaleViewManager;
11use Bitrix\Sale\Exchange\Integration\Entity\B24IntegrationStatProviderTable;
12use Bitrix\Sale\Result;
13use Bitrix\Main\Engine\Response\DataType\Page;
14use Bitrix\Main\UI\PageNavigation;
15
17{
18 //region Actions
19 public function getFieldsAction()
20 {
21 $view = $this->getViewManager()
22 ->getView($this);
23
24 return ['STATISTIC_PROVIDER'=>$view->prepareFieldInfos(
25 $view->getFields()
26 )];
27 }
28
40 public function listAction($select = [], $filter = [], $order = [], PageNavigation $pageNavigation = null): Page
41 {
42 return new Page('STATISTIC_PROVIDERS',
43 $this->getList($select, $filter, $order, $pageNavigation),
44 $this->count($filter)
45 );
46 }
47
56 public function getAction($id)
57 {
58 $r = $this->exists($id);
59 if($r->isSuccess())
60 {
61 return ['STATISTIC_PROVIDER'=>$this->get($id)];
62 }
63 else
64 {
65 $this->addErrors($r->getErrors());
66 return null;
67 }
68 }
69
78 public function addAction(array $fields)
79 {
80 $r = $this->existsByFilter(['XML_ID'=>$fields['XML_ID']]);
81
82 if($r->isSuccess() === false)
83 {
84 $r = parent::add($fields);
85 if($r->isSuccess())
86 {
87 return ['STATISTIC_PROVIDER'=>$this->get($r->getPrimary())];
88 }
89 }
90 else
91 {
92 $r->addError(new Error('Duplicate entry for key [xmlId]'));
93 }
94
95
96 $this->addErrors($r->getErrors());
97 return null;
98 }
99
109 public function updateAction($id, array $fields)
110 {
111 $r = $this->existsByFilter([
112 'XML_ID'=>$fields['XML_ID'],
113 '!ID'=>$id
114 ]);
115 if($r->isSuccess() === false)
116 {
117 $r = parent::update($id, $fields);
118 if($r->isSuccess())
119 {
120 return ['STATISTIC_PROVIDER'=>$this->get($id)];
121 }
122 }
123 else
124 {
125 $r->addError(new Error('Duplicate entry for key [xmlId]'));
126 }
127
128
129 $this->addErrors($r->getErrors());
130 return null;
131 }
132
141 public function deleteAction($id)
142 {
143 $r = parent::delete($id);
144 if($r->isSuccess())
145 {
146 return true;
147 }
148 else
149 {
150 $this->addErrors($r->getErrors());
151 return null;
152 }
153 }
154 //endregion
155
156 protected function createViewManager(Action $action)
157 {
158 return new SaleViewManager($action);
159 }
160
161 protected function getEntityTable()
162 {
164 }
165
166 protected function checkReadPermissionEntity()
167 {
168 return new Result();
169 }
170
171 protected function checkCreatePermissionEntity()
172 {
173 return new Result();
174 }
175
176 protected function checkUpdatePermissionEntity()
177 {
178 return new Result();
179 }
180
181 protected function checkDeletePermissionEntity()
182 {
183 return new Result();
184 }
185}
Определения error.php:15
listAction($select=[], $filter=[], $order=[], PageNavigation $pageNavigation=null)
Определения statisticprovider.php:40
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$select
Определения iblock_catalog_list.php:194
$filter
Определения iblock_catalog_list.php:54
$order
Определения payment.php:8
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
$action
Определения file_dialog.php:21