RegionSuggestItem
in package
FinalYes
One item of the municipality/postcode suggester. Plain data: it crosses the bridge as an array ({@see toArray()} / {@see fromArray()}); `Result::data` must not carry an entity.
label= text put into the field after selection and the row in the list (picker.jsrenders onlylabel, so it also tells same-named municipalities apart: "Lhota (Plzen-jih district, ...)"),name+meta= two-line form for the extendedpicker.js,postcode= postcode of the item without a space (postcode branch = the entered postcode, name branch = the main postcode of the municipality).
Table of Contents
Properties
- $country : string
- $countryCode : string
- $label : string
- $level : int
- $meta : string
- $name : string
- $path : string
- $postcode : string|null
- $regionId : int
- $type : string
Methods
- __construct() : mixed
- fromArray() : self|null
- toArray() : array{regionId: int, name: string, label: string, meta: string, type: string, level: int, countryCode: string, country: string, postcode: ?string, path: string}
- toPickerArray() : array{id: int, label: string, name: string, meta: string, type: string, data: array{city: string, zip: string, country: string, countryCode: string, path: string}}
- Returns the shape for the `picker.js` client (`id`/`label`/`data` are its contract, the rest serves the extended picker). JS spreads `data` into `data-picker-map-*` fields as a preview only; the server splits city/postcode/country on save by the selected municipality.
- str() : string
Properties
$country read-only
public
string
$country
$countryCode read-only
public
string
$countryCode
$label read-only
public
string
$label
$level read-only
public
int
$level
$meta read-only
public
string
$meta
$name read-only
public
string
$name
$path read-only
public
string
$path
$postcode read-only
public
string|null
$postcode
$regionId read-only
public
int
$regionId
$type read-only
public
string
$type
Methods
__construct()
public
__construct(int $regionId, string $name, string $label, string $meta, string $type, int $level, string $countryCode, string $country, string|null $postcode, string $path) : mixed
Parameters
- $regionId : int
- $name : string
- $label : string
- $meta : string
- $type : string
- $level : int
- $countryCode : string
- $country : string
- $postcode : string|null
- $path : string
fromArray()
public
static fromArray(array<string, mixed> $row) : self|null
Parameters
- $row : array<string, mixed>
Return values
self|nulltoArray()
public
toArray() : array{regionId: int, name: string, label: string, meta: string, type: string, level: int, countryCode: string, country: string, postcode: ?string, path: string}
Return values
array{regionId: int, name: string, label: string, meta: string, type: string, level: int, countryCode: string, country: string, postcode: ?string, path: string}toPickerArray()
Returns the shape for the `picker.js` client (`id`/`label`/`data` are its contract, the rest serves the extended picker). JS spreads `data` into `data-picker-map-*` fields as a preview only; the server splits city/postcode/country on save by the selected municipality.
public
toPickerArray() : array{id: int, label: string, name: string, meta: string, type: string, data: array{city: string, zip: string, country: string, countryCode: string, path: string}}
Return values
array{id: int, label: string, name: string, meta: string, type: string, data: array{city: string, zip: string, country: string, countryCode: string, path: string}}str()
private
static str(mixed $value) : string
Parameters
- $value : mixed