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
CITY_NAME_IDX
public
mixed
CITY_NAME_IDX
= 0
CITY_XML_ID_IDX
public
mixed
CITY_XML_ID_IDX
= 2
CSV_FILE_PATH
public
mixed
CSV_FILE_PATH
= ''
EXTERNAL_SERVICE_CODE
public
mixed
EXTERNAL_SERVICE_CODE
= ''
REGION_NAME_IDX
public
mixed
REGION_NAME_IDX
= 1
Methods
exportToCsv()
Export locations map from database to file, csv format.
public
static exportToCsv(string $path) : bool|int
Parameters
- $path : string
Return values
bool|intfillNormalizedTable()
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
Return values
intgetCityId()
Returns external location city id
public
static getCityId(int $locationId) : int|string
Parameters
- $locationId : int
Return values
int|stringgetExternalId()
Returns external location id
public
static getExternalId(int $locationId) : int|string
Parameters
- $locationId : int
Return values
int|stringgetExternalServiceId()
If exist returns id, if not exist create it
public
static getExternalServiceId() : int
Tags
Return values
int —External service Id
getInternalId()
Returns internal location id
public
static getInternalId(string $externalCode) : int
Parameters
- $externalCode : string
Return values
intgetLocationIdByNames()
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
Return values
intimportFromCsv()
Import locations map from csv file to database.
public
static importFromCsv(string $path) : bool|int
Parameters
- $path : string
Tags
Return values
bool|int —Quantity of mapped locations.
install()
Install locations map.
public
static install() : Result
Return values
ResultisInstalled()
Check locations map was sat.
public
static isInstalled() : bool
Return values
boolmap()
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
Return values
ResultsetCollectDuplicated()
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
Return values
boolsetExternalLocation2()
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
Return values
AddResult|Result|UpdateResultunInstall()
Uninstall locations map.
public
static unInstall() : Result