extends |
Persistence |
|---|
This class is used for typecasting model types to the values that will be presented to the user. App will always initialize this persistence in $app->uiPersistence and this object will be used by various UI elements to output data to the user.
Overriding and extending this class is a great place where you can tweak how various data-types are displayed to the user in the way so it would affect UI globally.
You may want to localize some of the output.
| Methods | ||
|---|---|---|
public
|
__construct()
|
# |
public
|
typecastSaveField(Field $field, $value): scalar|null
|
# |
protected
|
_typecastSaveField(Field $field, $value): string
|
# |
protected
|
_typecastLoadField(Field $field, $value)
|
# |
public
|
typecastSaveRow(Model $model, array $row): array
|
# |
| Methods inherited from Atk4\Data\Persistence |
|---|
connect(), disconnect(), add(), initPersistence(), atomic(), getDatabasePlatform(), tryLoad(), load(), insert(), insertRaw(), update(), updateRaw(), delete(), deleteRaw(), typecastLoadRow(), typecastLoadField(), |
| Methods used from Atk4\Core\ContainerTrait |
|---|
_uniqueElementName(), _addContainer(), removeElement(), _shorten(), getElement(), hasElement() |
| Methods used from Atk4\Core\DiContainerTrait |
|---|
setDefaults(), setMissingProperty(), assertInstanceOf(), _fromSeedPrecheck(), fromSeed(), fromSeedUnsafe() |
| Methods used from Atk4\Core\DynamicMethodTrait |
|---|
__call(), buildMethodHookName(), addMethod(), hasMethod(), removeMethod() |
| Constants inherited from Atk4\Data\Persistence |
|---|
|
| Properties | |||
|---|---|---|---|
public
|
string
|
$locale = 'en'
|
# |
public
|
'.'|','
|
$decimalSeparator = '.'
|
# |
public
|
''|' '|','|'.'
|
$thousandsSeparator = ' '
|
# |
public
|
string
|
$currency = '€'
|
# |
public
|
int
|
$currencyDecimals = 2
|
# |
public
|
string
|
$timezone
|
# |
public
|
string
|
$dateFormat = 'M j, Y'
|
# |
public
|
string
|
$timeFormat = 'H:i'
|
# |
public
|
string
|
$datetimeFormat = 'M j, Y H:i'
|
# |
public
|
int
|
$firstDayOfWeek = 0
|
# |
public
|
string
|
$yes = 'Yes'
|
# |
public
|
string
|
$no = 'No'
|
# |
| Properties inherited from Atk4\Data\Persistence |
|---|
$typecastSaveSkipNormalize |
| Properties used from Atk4\Core\ContainerTrait |
|---|
$elements, $_elementNameCounts |
| Properties used from Atk4\Core\HookTrait |
|---|
$hooks, $_hookIndexCounter, $_hookOrigThis |
| Properties used from Atk4\Core\NameTrait |
|---|
$name |