44 public static function check($params, array $restrictionParams, $serviceId = 0)
46 if ((
int)$serviceId <= 0)
54 return CompanyLocationTable::checkConnectionExists(
58 'LOCATION_LINK_TYPE' =>
'AUTO'
73 protected static function extractParams(
Entity $entity)
78 $order = $entity->getCollection()->getOrder();
80 elseif ($entity instanceof
Order)
89 if(!$props = $order->getPropertyCollection())
92 if(!$locationProp = $props->getDeliveryLocation())
95 if(!$locationCode = $locationProp->getValue())
110 $arLocation = array();
112 if(!!\CSaleLocation::isLocationProEnabled())
114 if($params[
"LOCATION"][
'L'] <>
'')
116 $LOCATION1 = explode(
':', $params[
"LOCATION"][
'L']);
119 if($params[
"LOCATION"][
'G'] <>
'')
121 $LOCATION2 = explode(
':', $params[
"LOCATION"][
'G']);
125 if (isset($LOCATION1) && is_array($LOCATION1) && count($LOCATION1) > 0)
127 $arLocation[
"L"] = array();
128 $locationCount = count($LOCATION1);
130 for ($i = 0; $i<$locationCount; $i++)
131 if($LOCATION1[$i] <>
'')
133 $arLocation[
"L"][] = $LOCATION1[$i];
137 if (isset($LOCATION2) && is_array($LOCATION2) && count($LOCATION2) > 0)
139 $arLocation[
"G"] = array();
140 $locationCount = count($LOCATION2);
142 for ($i = 0; $i<$locationCount; $i++)
143 if($LOCATION2[$i] <>
'')
145 $arLocation[
"G"][] = $LOCATION2[$i];
150 CompanyLocationTable::resetMultipleForOwner($companyId, $arLocation);
165 "TYPE" =>
"COMPANY_LOCATION_MULTI"
170 $result[
"LOCATION"][
"COMPANY_ID"] = $entityId;
180 public static function save(array $fields, $restrictionId = 0)
182 $fields[
"PARAMS"] = self::prepareParamsForSaving($fields[
"PARAMS"], $fields[
"SERVICE_ID"]);
183 return parent::save($fields, $restrictionId);
191 public static function delete($restrictionId, $entityId = 0)
193 CompanyLocationTable::resetMultipleForOwner($entityId);
194 return parent::delete($restrictionId);
static loadMessages($file)
static getMessage($code, $replace=null, $language=null)