com\setasign\Konquadrat\Field

Select

File: /Konquadrat/src/Field/Select.php

Class hierarchy

Summary

Constants

ALLOW_NULL_VALUE

protected const Select::ALLOW_NULL_VALUE = false

Properties

$dirty

protected bool AbstractField::$dirty = false

If this flag is true it couldn't correctly be loaded from the database.

$fieldConfig

$fieldContainer

$languageManager

$messageList

$value

protected mixed AbstractField::$value

The field value


Static Methods

getClassNameByType()

public static AbstractField::getClassNameByType (
string $type
): string

Get the matching field class name for $type.

Parameters
$type : string
 

render()

public static Select::render (
\com\setasign\Konquadrat\LanguageManager $languageManager,
\Traversable|array $options,
string $value,
bool $useSystemLanguage = false
): string

Get the display text for the option $value.

Parameters
$languageManager : \com\setasign\Konquadrat\LanguageManager
 
$options : \Traversable|array
 
$value : string
 
$useSystemLanguage : bool
 

validateValue()

public static Select::validateValue (
array $fieldConfig,
$columnValue
): void
Parameters
$fieldConfig : array
 
$columnValue
 
Exceptions

Throws InvalidValueException


Methods

__construct()

public AbstractField::__construct (
\com\setasign\Konquadrat\LanguageManager $languageManager,
\com\setasign\Konquadrat\Object\MessageList $messageList,
FieldContainer\FieldContainerInterface $fieldContainer,
string $name,
array $fieldConfig
)

AbstractField constructor.

Parameters
$languageManager : \com\setasign\Konquadrat\LanguageManager
 
$messageList : \com\setasign\Konquadrat\Object\MessageList
 
$fieldContainer : FieldContainer\FieldContainerInterface
 
$name : string

The field name

$fieldConfig : array

The field configuration

Exceptions

Throws \com\setasign\Konquadrat\Exception

__clone()

public AbstractField::__clone (
void
): void
Exceptions

Throws \com\setasign\Konquadrat\Exception

__sleep()

public AbstractField::__sleep (
void
): void

callGetMethod()

public Select::callGetMethod (
callable $getMethod
): mixed

Wrapper method to ensure the correct value type

Parameters
$getMethod : callable
 

getDefaultValue()

public Select::getDefaultValue (
void
): string

Get the value for the default option.

getFieldConfig()

public AbstractField::getFieldConfig (
void
): array

getLabel()

public AbstractField::getLabel (
void
): string

getName()

public AbstractField::getName (
void
): string

Return the name

getText()

public Select::getText (
bool $useSystemLanguage = false
): string

Get the display text for the chosen option.

Parameters
$useSystemLanguage : bool
 

getValue()

public AbstractField::getValue (
void
): ?mixed

Get the value

isDirty()

public AbstractField::isDirty (
void
): bool

Checks whether the field could correctly be loaded from the database.

parseValue()

protected Select::parseValue (
mixed $value
): string

Parse the value to the correct type

Parameters
$value : mixed
 
Exceptions

Throws \InvalidArgumentException

setValue()

public Select::setValue (
mixed|DefaultValue $value
): void

Set the value

Parameters
$value : mixed|DefaultValue