6use Bitrix\Sale\TradingPlatform;
14 private $tradePlatform =
null;
38 'ORDER_ID',
'EXTERNAL_ORDER_ID',
39 'TRADING_PLATFORM_ID',
'PARAMS',
'XML_ID'
69 $entity = static::createEntityObject();
79 $entity->setFieldNoDemand(
'XML_ID', static::generateXmlId());
103 return new $entityClassName(
$fields);
114 public static function loadForOrder($id)
116 if (intval($id) <= 0)
125 $dbRes = $tradeBindingCollection::getList([
126 'filter' => [
'ORDER_ID' => $id]
132 $entityList[] = static::createEntityObject(
$data);
142 public function save()
144 $result =
new Result();
151 $id = $this->
getId();
155 $fields = $this->
getFields()->getChangedValues();
157 $result->setId($r->getId());
169 if ((
int)$this->getField(
'EXTERNAL_ORDER_ID') <= 0)
174 $fields = $this->
getFields()->getValues();
183 if (!$r->isSuccess())
185 $result->addErrors($r->getErrors());
203 $tradingPlatformId = (int)$this->getField(
'TRADING_PLATFORM_ID');
204 if (($this->tradePlatform ===
null) && $tradingPlatformId > 0)
209 return $this->tradePlatform;
220 return TradingPlatform\OrderTable::update($primary,
$data);
230 return TradingPlatform\OrderTable::add(
$data);
240 return 'SaleTradeBindingEntity';
251 parent::setFieldNoDemand(
$name, $value);
253 if (
$name ===
'TRADING_PLATFORM_ID')
255 $this->tradePlatform =
null;
261 $result = parent::onFieldModify(
$name, $oldValue, $value);
262 if (!$result->isSuccess())
267 if (
$name ===
'TRADING_PLATFORM_ID')
269 $this->tradePlatform =
null;
const ENTITY_TRADE_BINDING_COLLECTION
static getInstance($type)
const REGISTRY_TYPE_ORDER
const ENTITY_TRADE_BINDING_ENTITY
onFieldModify($name, $oldValue, $value)
static getRegistryEntity()
updateInternal($primary, array $data)
static getMeaningfulFields()
static getEntityEventName()
static getAvailableFields()
setFieldNoDemand($name, $value)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)