com\setasign\Konquadrat\Field

Magic

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

Class hierarchy

Summary

Constants

ALLOW_NULL_VALUE

protected const AbstractField::ALLOW_NULL_VALUE = true

Properties

$cachedResult

protected ?string Magic::$cachedResult

$db

protected Magic::$db

$dirty

protected bool AbstractField::$dirty = false

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

$fieldConfig

$fieldContainer

$languageManager

$messageList

$objectConfig

protected Magic::$objectConfig

$objectFinder

protected Magic::$objectFinder

$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
 

Methods

__construct()

public Magic::__construct (
\com\setasign\Konquadrat\LanguageManager $languageManager,
\com\setasign\Konquadrat\Object\MessageList $messageList,
\com\setasign\SetaFramework\Database\Database $db,
\com\setasign\Konquadrat\Object\ObjectFinder $objectFinder,
\com\setasign\Konquadrat\Object\ObjectConfig $objectConfig,
FieldContainer\FieldContainerInterface $fieldContainer,
string $name,
array $fieldConfig
)

Magic constructor.

Parameters
$languageManager : \com\setasign\Konquadrat\LanguageManager
 
$messageList : \com\setasign\Konquadrat\Object\MessageList
 
$db : \com\setasign\SetaFramework\Database\Database
 
$objectFinder : \com\setasign\Konquadrat\Object\ObjectFinder
 
$objectConfig : \com\setasign\Konquadrat\Object\ObjectConfig
 
$fieldContainer : FieldContainer\FieldContainerInterface
 
$name : string
 
$fieldConfig : array
 
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 Magic::callGetMethod (
callable $getMethod
): mixed

Wrapper method to ensure the correct value type

Parameters
$getMethod : callable
 

fetchValue()

public Magic::fetchValue (
void
): string

getDefaultValue()

public Magic::getDefaultValue (
void
): ?mixed

getFieldConfig()

public AbstractField::getFieldConfig (
void
): array

getLabel()

public AbstractField::getLabel (
void
): string

getName()

public AbstractField::getName (
void
): string

Return the name

getQuery()

public Magic::getQuery (
void
): string
Exceptions

Throws \com\setasign\Konquadrat\Exception

getValue()

public Magic::getValue (
void
): string

Get the value

hasCachedResult()

public Magic::hasCachedResult (
void
): bool

isDirty()

public AbstractField::isDirty (
void
): bool

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

parseValue()

protected Magic::parseValue (
mixed $value
): ?mixed

Parse the value to the correct type.

Parameters
$value : mixed
 
Exceptions

Throws \Throwable Throws an exception if the value is invalid.

resetCachedResult()

public Magic::resetCachedResult (
void
): void

setValue()

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

Set the value

Parameters
$value : mixed|DefaultValue