36 return Loc::getMessage(
'SALE_SRV_RSTR_BY_TRADE_BINDING_ON_APPLY_ERROR_MSG');
51 "TRADE_BINDING" => array(
55 "OPTIONS" => self::getTradePlatformList()
70 protected static function getTradePlatformList()
72 Loader::includeModule(
'crm');
76 $dbRes = Sale\TradingPlatformTable::getList([
77 'select' => [
'CODE',
'CLASS'],
78 'filter' => [
'=ACTIVE' =>
'Y'],
79 'cache' => [
'ttl' => 36000]
81 while ($data = $dbRes->fetch())
83 $platformClassName = (string)$data[
'CLASS'];
84 if (class_exists($platformClassName))
87 $platform = $platformClassName::getInstanceByCode($data[
'CODE']);
90 $result[$platform->getId()] = $platform->getRealName();
112 $order = static::getOrder($entity);
119 $collection = $order->getTradeBindingCollection();
122 foreach ($collection as $entity)
124 $tradeBinding = $entity->getTradePlatform();
127 && !in_array($tradeBinding->getId(), $result)
130 $result[] = $tradeBinding->getId();
152 public static function check($params, array $restrictionParams, $serviceId = 0)
154 if (is_array($restrictionParams) && isset($restrictionParams[
'TRADE_BINDING']))
156 $diff = array_diff($params, $restrictionParams[
'TRADE_BINDING']);
173 return (
bool)static::getTradePlatformList();
static loadMessages($file)
static getMessage($code, $replace=null, $language=null)