9use Bitrix\Main\Entity\ExpressionField;
18 public function getPrimaryAutoWiredParameter()
21 Sale\PropertyValue::class,
23 function($className, $id) {
27 $propertyValueClass = $registry->getPropertyValueClassName();
29 $r = $propertyValueClass::getList([
30 'select'=>[
'ORDER_ID'],
34 if($row = $r->fetch())
37 $orderClass = $registry->getOrderClassName();
39 $propertyValue = $orderClass::load($row[
'ORDER_ID'])
40 ->getPropertyCollection()
44 return $propertyValue;
49 $this->addError(
new Error(
'property value is not exists', 201040400001));
59 $view = $this->getViewManager()
62 return [
'PROPERTY_VALUE'=>$view->prepareFieldInfos(
70 $builder->buildEntityProperties($fields);
72 if($builder->getErrorsContainer()->getErrorCollection()->count()>0)
74 $this->addErrors($builder->getErrorsContainer()->getErrors());
78 $order = $builder->getOrder();
83 $this->addErrors($r->getErrors());
87 return [
'PROPERTY_VALUES'=>$this->
toArray($order)[
'ORDER'][
'PROPERTY_VALUES']];
92 $r = $propertyValue->delete();
102 $this->addErrors($r->getErrors());
104 return $r->isSuccess();
109 return [
'PROPERTY_VALUE'=>$this->
getItem($propertyValue)];
114 $select = empty($select) ? [
'*'] : $select;
115 $order = empty($order) ? [
'ID'=>
'ASC'] : $order;
117 new \Bitrix\Main\Entity\ReferenceField(
119 '\Bitrix\Sale\Internals\OrderPropsTable',
120 array(
'=this.ORDER_PROPS_ID' =>
'ref.ID')
124 $payments = \Bitrix\Sale\PropertyValue::getList(
129 'offset' => $pageNavigation->
getOffset(),
130 'limit' => $pageNavigation->
getLimit(),
131 'runtime' => $runtime,
135 return new Page(
'PROPERTY_VALUES', $payments,
function() use ($select, $filter, $runtime)
153 function ($item) use ($propertyValue){
154 if($propertyValue->getPropertyId() == $item[
'ORDER_PROPS_ID'])
167 if(isset($fields[
'PROPERTY_VALUES']))
169 foreach($fields[
'PROPERTY_VALUES'] as $field)
171 $data[$field[
'ORDER_PROPS_ID']]=$field[
'VALUE'];
174 return is_array($data)?[
'PROPERTIES'=>$data]:[];
182 if ($saleModulePermissions <
"W")
184 $r->addError(
new Error(
'Access Denied', 200040300020));
194 if ($saleModulePermissions ==
"D")
196 $r->addError(
new Error(
'Access Denied', 200040300010));
203 $name = mb_strtolower($name);
205 if($name ==
'modify')
211 $r = parent::checkPermissionEntity($name);
static getList(array $parameters)
toArray(\Bitrix\Sale\Order $order, array $fields=[])
getBuilder(SettingsContainer $settings=null)
getItem(Sale\PropertyValue $propertyValue, array $fields=[])
checkModifyPermissionEntity()
static prepareFields($fields)
checkReadPermissionEntity()
modifyAction(array $fields)
deleteAction(Sale\PropertyValue $propertyValue)
getAction(Sale\PropertyValue $propertyValue)
listAction(PageNavigation $pageNavigation, array $select=[], array $filter=[], array $order=[])
checkPermissionEntity($name, $arguments=[])
const REGISTRY_TYPE_ORDER