class Select implements FieldInterface, HasLabelsInterface

Traits

Methods

static void
addSpecialValues(array $row, array $config)

No description

static string
decorateSearchTableValue(xm_lookbook $mod, array $row, array $profiles, array $propertyConfig, array $userMeta)

No description

static array|null
formatProperty(array $property, array $config)

No description

static array
getAdditionalEditFDL(array $field, array $fdl)

No description

static array
getConfigFields()

Provides a default has_labels config option.

static array
getEditFDL(Controller $mod, array $field, Form $form, int $profileId, int $copyId, array $config)

Generates key => value pairs to map database-saved keys to displayed labels for form fields (e.g. in select dropdowns), if field has labels.

static string
getPropertySearchQuery(string $searchWord, array $alternatives, xm_lookbook_property $property)

No description

static string
getValueLabels(string|null $propertyConfig, string $propertyValues, string $propertyValue, string $glue = '; ')

Replaces all keys with the according labels in the property's value.

static bool
hasLabels(string|null $propertyConfig)

Returns whether the field is configured to use labels.

static array
parseLabeledValues(string|null $propertyConfig, string $propertyValues)

Parses the property's values string into an array with key => value pairs, for example: "key1=label1;key2=label2" becomes ['key1' => 'label1', 'key2' => 'label2'].

static void
preparePropertyDisplay(xm_lookbook $mod, xm_lookbook_profile $profile, array $property, array $config)

No description

static string|null
processConfigVariables(int $profileId, int $propertyId, string $fieldValue, int $copy, array $propertyConfig, string $profilePropertyConfig)

No description

static bool
processSubmittedValue(xm_lookbook $mod, int $profileId, string $submittedValue, array $field, string $fieldName, int $copy, array $config, array $fieldErrors, array $propertyValues)

No description

static void
shapeFieldSearchParams(array $fieldInput, string $fieldName, array $searchParams)

No description

Details

in FieldTrait at line 164
static void addSpecialValues(array $row, array $config)

No description

Parameters

array $row
array $config

Return Value

void

in FieldTrait at line 137
static string decorateSearchTableValue(xm_lookbook $mod, array $row, array $profiles, array $propertyConfig, array $userMeta)

No description

Parameters

xm_lookbook $mod
array $row
array $profiles
array $propertyConfig
array $userMeta

Return Value

string

at line 27
static array|null formatProperty(array $property, array $config)

No description

Parameters

array $property
array $config

Return Value

array|null

in FieldTrait at line 42
static array getAdditionalEditFDL(array $field, array $fdl)

No description

Parameters

array $field
array $fdl

Return Value

array

in HasLabelsTrait at line 17
static array getConfigFields()

Provides a default has_labels config option.

Return Value

array

in HasLabelsTrait at line 38
static array getEditFDL(Controller $mod, array $field, Form $form, int $profileId, int $copyId, array $config)

Generates key => value pairs to map database-saved keys to displayed labels for form fields (e.g. in select dropdowns), if field has labels.

Parameters

Controller $mod
array $field
Form $form
int $profileId
int $copyId
array $config

Return Value

array

at line 40
static string getPropertySearchQuery(string $searchWord, array $alternatives, xm_lookbook_property $property)

No description

Parameters

string $searchWord
array $alternatives
xm_lookbook_property $property

Return Value

string

in HasLabelsTrait at line 116
static string getValueLabels(string|null $propertyConfig, string $propertyValues, string $propertyValue, string $glue = '; ')

Replaces all keys with the according labels in the property's value.

The key=value pairs are generated from all possible values of the property. Handles also multiple values, e.g. for Checkbox.

Parameters

string|null $propertyConfig

The property's config

string $propertyValues

All valid values of the property, possibly as key=value pairs

string $propertyValue

The property's actual value, in which to replace the keys with the labels

string $glue

Used to concat the parsed labels

Return Value

string

The replaced and concatenated labels for the property value

in HasLabelsTrait at line 70
static bool hasLabels(string|null $propertyConfig)

Returns whether the field is configured to use labels.

The $propertyConfig string is parsed into an array and checked for the has_labels key.

Parameters

string|null $propertyConfig

The property's config string.

Return Value

bool

true if field has labels.

in HasLabelsTrait at line 85
static array parseLabeledValues(string|null $propertyConfig, string $propertyValues)

Parses the property's values string into an array with key => value pairs, for example: "key1=label1;key2=label2" becomes ['key1' => 'label1', 'key2' => 'label2'].

Parameters

string|null $propertyConfig

The property's config

string $propertyValues

Return Value

array

in FieldTrait at line 175
static void preparePropertyDisplay(xm_lookbook $mod, xm_lookbook_profile $profile, array $property, array $config)

No description

Parameters

xm_lookbook $mod
xm_lookbook_profile $profile
array $property
array $config

Return Value

void

in FieldTrait at line 111
static string|null processConfigVariables(int $profileId, int $propertyId, string $fieldValue, int $copy, array $propertyConfig, string $profilePropertyConfig)

No description

Parameters

int $profileId
int $propertyId
string $fieldValue
int $copy
array $propertyConfig
string $profilePropertyConfig

Return Value

string|null

at line 78
static bool processSubmittedValue(xm_lookbook $mod, int $profileId, string $submittedValue, array $field, string $fieldName, int $copy, array $config, array $fieldErrors, array $propertyValues)

No description

Parameters

xm_lookbook $mod
int $profileId
string $submittedValue
array $field
string $fieldName
int $copy
array $config
array $fieldErrors
array $propertyValues

Return Value

bool

at line 98
static void shapeFieldSearchParams(array $fieldInput, string $fieldName, array $searchParams)

No description

Parameters

array $fieldInput
string $fieldName
array $searchParams

Return Value

void