CoolCMS API

PaymentPickerTrait

Payment picker (single field): suggestions by payment code plus a modal over the System Payment grid ("Search" button). Like {@see UserPickerTrait}.

IMPORTANT: the modal works only because Admin:System:Payment has the picker mode in its grid (if ($this->picker !== '') { $grid->setPickerMode(...) }). If the picker mode is removed from the grid, targetPresenter: null must return here; otherwise the "Search" button opens a modal with a plain grid without "Select" buttons.

Table of Contents

Properties

$paymentManager  : PaymentManager

Methods

paymentPicker()  : PickerConfig
resolvePaymentLabel()  : string|null
suggestPayments()  : array<int, array{id: int, label: string}>
Suggestions: searches by variable symbol and payment code (OR).

Properties

Methods

paymentPicker()

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

resolvePaymentLabel()

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

suggestPayments()

Suggestions: searches by variable symbol and payment code (OR).

private suggestPayments(string $query) : array<int, array{id: int, label: string}>

NOTE: a code is filled in only for a minority of payments, so a code-only filter would leave most of them unfindable. The label is built by PaymentPickerLabel, the same function as in the modal over the grid.

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

Search results