CoolCMS API

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.js renders only label, so it also tells same-named municipalities apart: "Lhota (Plzen-jih district, ...)"),
  • name + meta = two-line form for the extended picker.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

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|null

toArray()

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
Return values
string
On this page

Search results