Convert DAO value for HTML display
Do NOT use if PHP is multi threaded
| package | salt\converter |
|---|---|
| inherited_from | \salt\AbstractConverter |
__get(string $field) : mixed
stringField name
mixedconverter value__set(string $field, mixed $value)
stringField name
mixedValue
column(\salt\Base $object, \salt\Field $field, mixed $value, string $format, array<mixed,mixed> $params) : string
\salt\BaseThe singleton object
\salt\Fieldthe field to display
mixedthe default value
stringformat to use for change the output
array<mixed,mixed>others parameters passed to convert function
stringHTML escaped text for describe $field in $formatconvert(mixed $value) : mixed
convert(mixed $value) : mixed
convertAs(\salt\Base $otherObject, mixed $value, string $method = NULL) : mixed
\salt\BaseAn instance of the other object (retrieve it with ::singleton())
mixedThe value to convert
stringOptional, override the method to use for convert, one of DAOConverter::METHOD_*
mixedthe converted valueconvertForSetter(mixed $value) : mixed
convertForSetter(mixed $value) : mixed
edit(\salt\Base $object, \salt\Field $field, mixed $value, string $format, array<mixed,mixed> $params) : string
\salt\Baseobject that contains the value
\salt\Fieldthe field
mixedthe value to edit
stringformat to use
array<mixed,mixed>others parameters passed to convert function
stringa full HTML form tag (input, select, etc...) for editing the valuegetContext() : mixed
mixed$context The contextgetField() : string
stringthe field namegetInstance(object|string $object= NULL, mixed $context= NULL, string $fieldName= NULL) : static
objectstringObject or class name for static call
mixedcontext to pass at convert method
stringset field name : use it when delegate calls between DAOConverters only.
staticthe converter instancegetObject() : object | string
objectstring$object Instance of class name of the objectgetValue(string $field) : mixed | NULL
getValue(string $field) : mixed | NULL
stringfield name
mixedNULLthe field value on current object or NULL if there is no current objectsetter(\salt\Field $field, mixed $value) : mixed
\salt\Fieldfield
mixedthe value to convert
mixedthe converted valuesetterDB(\salt\Field $field, mixed $value, string $format) : mixed
\salt\Fieldfield
mixedthe value to convert
stringthe format to use
mixedthe converted valuesetterInput(\salt\Base $object, \salt\Field $field, mixed $value, string $format, array<mixed,mixed> $params) : mixed
\salt\Baseobject that contains the value
\salt\Fieldfield
mixedthe value to convert
stringthe format of the value
array<mixed,mixed>others parameters passed to convert function
mixedthe converted valueshow(\salt\Base $object, \salt\Field $field, mixed $value, string $format, array<mixed,mixed> $params) : string
\salt\Baseobject that contains the value
\salt\Fieldthe field
mixedthe value to display
stringformat to use
array<mixed,mixed>others parameters passed to convert function
stringan HTML escaped valuesql(\salt\Base $object, \salt\Field $field, mixed $value, string $format, array<mixed,mixed> $params) : mixed
This method DO NOT make any SQL escape. With PDO or similar, we don't need escape
\salt\Baseobject that contains the value
\salt\Fieldfield
mixedthe value to convert
stringthe format of the value
array<mixed,mixed>others parameters passed to convert function
mixedthe value for using in SQL querytext(\salt\Base $object, \salt\Field $field, mixed $value, string $format, array<mixed,mixed> $params) : string
\salt\Baseobject that contains the value
\salt\Fieldthe field
mixedthe value to display
stringformat to use
array<mixed,mixed>others parameters passed to convert function
stringa non-HTML escaped value_init(array<mixed,mixed> $context= NULL, object $object= NULL, string $field= NULL)
array<mixed,mixed>an array with format entry
objectthe object
stringthe field name
convertFromExternal(string $field, mixed $value, string $format) : mixed
A value for a boolean field is converted to boolean. A value for a date field is converted to timestamp.
stringField name
mixedvalue to convert
stringdate format
mixedthe converted valueconvertNullValues(\salt\Field $field, mixed $value, string $format) : NULL | string
Any nullable field with an empty string value will be NULL. If we want a real empty string, we have to use Field::EMPTY_STRING instead
\salt\Fieldthe field
mixedthe value
stringthe format from convert function
NULLstringthe converted value__construct()
delegateTo(mixed $value, array<mixed,string> $validMethods) : mixed
mixedvalue to convert
array<mixed,string>valid methods
mixedthe converted value$_salt_context : array<mixed,mixed>
NULL$_salt_field : string
NULL$_salt_instances : array<mixed,\salt\Converter>
array()$_salt_object : object
NULLMETHOD_COLUMN = 'column'
METHOD_EDIT = 'edit'
METHOD_SET = 'setterInput'
METHOD_SHOW = 'show'
METHOD_SQL = 'sql'
METHOD_TEXT = 'text'