CoolCMS API

TariffPickerTrait

Topping tariff picker (single field): suggest by name (`translations.name`) plus a modal with the `show` grid of `:Admin:Discussion:Tariff`, which has a picker mode.

Table of Contents

Properties

$tariffManager  : TariffManager

Methods

tariffPicker()  : PickerConfig
resolveTariffLabel()  : string|null
suggestTariffs()  : array<int, array{id: int, label: string}>
Suggests tariffs by a `LIKE` match on the name in the current language.
tariffLabel()  : string

Properties

Methods

tariffPicker()

protected tariffPicker([string $formName = 'editForm' ][, string $targetField = 'tariffId' ]) : PickerConfig
Parameters
$formName : string = 'editForm'
$targetField : string = 'tariffId'
Return values
PickerConfig

resolveTariffLabel()

private resolveTariffLabel(int $id) : string|null
Parameters
$id : int
Return values
string|null

suggestTariffs()

Suggests tariffs by a `LIKE` match on the name in the current language.

private suggestTariffs(string $query) : array<int, array{id: int, label: string}>
Parameters
$query : string
Return values
array<int, array{id: int, label: string}>
On this page

Search results