23 if ($name ===
'getfieldsbyfilter')
25 $arguments[
'filter'][
'productType'] = static::TYPE;
29 return parent::processBeforeAction($action);
32 private function isAllowedProductTypeByIBlockId(Engine\
Action $action):
Result
34 $arguments = $action->getArguments();
35 $fields = $arguments[
'fields'];
38 $view = $this->getViewManager()->getView($this);
39 return $view->isAllowedProductTypeByIBlockId(static::TYPE, $fields[
'iblockId']);
44 $r = parent::processBeforeAdd($action);
48 $r = $this->isAllowedProductTypeByIBlockId($action);
56 $r = parent::processBeforeUpdate($action);
60 $r = $this->isAllowedProductTypeByIBlockId($action);
73 $fields[
'TYPE'] = static::TYPE;
74 $result = parent::addAction($fields);
81 $result = parent::updateAction($id, $fields);
96 $view = $this->getViewManager()->getView($this);
97 $r = $view->isAllowedProductTypeByIBlockId(static::TYPE, $filter[
'IBLOCK_ID']);
100 $this->addErrors($r->getErrors());
107 if (isset($filter[
'TYPE']))
109 $filter[
'TYPE'] = in_array($filter[
'TYPE'], $list,
true) ? $filter[
'TYPE'] : $list;
113 $filter[
'TYPE'] = $list;
116 return parent::listAction($pageNavigation, $select, $filter, $order);
119 protected function get($id)
121 $result = parent::get($id);
123 if (empty($result) ===
false)
setArguments(array $arguments)