Bitrix API

Mapper extends ExternalLocationMap

AbstractYes

Class ExternalLocationMap

Table of Contents

Constants

CITY_NAME_IDX  = 0
CITY_XML_ID_IDX  = 2
CSV_FILE_PATH  = ''
EXTERNAL_SERVICE_CODE  = ''
REGION_NAME_IDX  = 1

Methods

exportToCsv()  : bool|int
Export locations map from database to file, csv format.
fillNormalizedTable()  : int
Fill table b_sale_hdaln with locations with normalized names
getCityId()  : int|string
Returns external location city id
getExternalId()  : int|string
Returns external location id
getExternalServiceId()  : int
If exist returns id, if not exist create it
getInternalId()  : int
Returns internal location id
getLocationIdByNames()  : int
importFromCsv()  : bool|int
Import locations map from csv file to database.
install()  : Result
Install locations map.
isInstalled()  : bool
Check locations map was sat.
map()  : array<string|int, mixed>
refresh()  : Result
Refresh locations map.
setCollectDuplicated()  : mixed
setCollectMapped()  : mixed
setCollectNotFound()  : mixed
setExternalLocation()  : bool
setExternalLocation2()  : AddResult|Result|UpdateResult
unInstall()  : Result
Uninstall locations map.

Constants

Methods

exportToCsv()

Export locations map from database to file, csv format.

public static exportToCsv(string $path) : bool|int
Parameters
$path : string
Return values
bool|int

fillNormalizedTable()

Fill table b_sale_hdaln with locations with normalized names

public static fillNormalizedTable([int|bool $startId = false ][, int $timeout = 0 ]) : int
Parameters
$startId : int|bool = false
$timeout : int = 0
Tags
throws
SqlQueryException
Return values
int

getCityId()

Returns external location city id

public static getCityId(int $locationId) : int|string
Parameters
$locationId : int
Return values
int|string

getExternalId()

Returns external location id

public static getExternalId(int $locationId) : int|string
Parameters
$locationId : int
Return values
int|string

getExternalServiceId()

If exist returns id, if not exist create it

public static getExternalServiceId() : int
Tags
throws
Exception
Return values
int

External service Id

getInternalId()

Returns internal location id

public static getInternalId(string $externalCode) : int
Parameters
$externalCode : string
Return values
int

getLocationIdByNames()

public static getLocationIdByNames(string $name, string $city, string $subregion, string $region[, string $country = '' ][, bool $exactOnly = false ]) : int
Parameters
$name : string

Location name.

$city : string

Citry name.

$subregion : string

Subregions name.

$region : string

Region name.

$country : string = ''

Country name.

$exactOnly : bool = false

If we search exact name, or partly coincidence is enought

Tags
throws
SqlQueryException
throws
Exception
Return values
int

importFromCsv()

Import locations map from csv file to database.

public static importFromCsv(string $path) : bool|int
Parameters
$path : string
Tags
throws
ArgumentException
throws
Exception
Return values
bool|int

Quantity of mapped locations.

install()

Install locations map.

public static install() : Result
Return values
Result

isInstalled()

Check locations map was sat.

public static isInstalled() : bool
Return values
bool

map()

public abstract map(string $stage[, string $step = '' ][, int $progress = 0 ][, int $timeout = 0 ]) : array<string|int, mixed>
Parameters
$stage : string

Identities current stage.

$step : string = ''

Idenifies current step of the stage.

$progress : int = 0

Operation progress (%) 0 - 100.

$timeout : int = 0

Seconds for stepping.

Return values
array<string|int, mixed>

refresh()

Refresh locations map.

public static refresh() : Result
Tags
throws
ArgumentNullException
Return values
Result

setCollectDuplicated()

public setCollectDuplicated(mixed $collect) : mixed
Parameters
$collect : mixed

setCollectMapped()

public setCollectMapped(mixed $collect) : mixed
Parameters
$collect : mixed

setCollectNotFound()

public setCollectNotFound(mixed $collect) : mixed
Parameters
$collect : mixed

setExternalLocation()

public static setExternalLocation(int $srvId, int $locationId, string $xmlId[, bool $updateExist = false ]) : bool
Parameters
$srvId : int
$locationId : int
$xmlId : string
$updateExist : bool = false
Tags
throws
ArgumentNullException
throws
ArgumentException
throws
Exception
Return values
bool

setExternalLocation2()

public static setExternalLocation2(int $srvId, int $locationId, string $xmlId[, bool $updateExist = false ]) : AddResult|Result|UpdateResult
Parameters
$srvId : int
$locationId : int
$xmlId : string
$updateExist : bool = false
Tags
throws
ArgumentNullException
throws
ArgumentException
throws
Exception
Return values
AddResult|Result|UpdateResult

unInstall()

Uninstall locations map.

public static unInstall() : Result
Tags
throws
Exception
Return values
Result

        
On this page

Search results