ChkbxlstField
class ChkbxlstField extends CommonSellistField (View source)
Class to chkbxlst field (multiselect)
Constants
| MAP_ID_TO_CODE |
|
Properties
| DoliDB | $db | from CommonField | |
| string | $error | from CommonField | |
| string[] | $errors | from CommonField | |
| string | $type | from CommonField | |
| string | $label | from CommonField | |
| static Form|null | $form | from CommonField | |
| static Validate|null | $validator | from CommonField | |
| array<int, mixed> | $emptyValues | ||
| static string | $ajaxUrl | from CommonSellistField | |
| static array<string, array<string, array{label: string, parent: string}>> | $options | from CommonSellistField |
Methods
Check if the value is deemed as empty
Return HTML string to put an input search field into a page
Return HTML string to put an input field into a page
Return HTML string to show a field into a page
Get input CSS
Verify if the field value is valid
Verify if the field value from GET/POST is valid
Get field value from GET/POST
Get search field value from GET/POST
Get sql filter for search field
Get all parameters in the options
Get sql info of the full field
Get list of options
Details
__construct(DoliDB $db)
Constructor
static void
setForm(Form $form)
Set form used for print the field
static void
setValidator(Validate $validator)
Set validator used for check the field value
void
clearErrors()
clear errors
string
errorsToString(string $separator = ', ')
Method to output saved errors
bool
isEmptyValue(FieldInfos $fieldInfos, mixed $value, array<int, mixed> $emptyValues = null)
Check if the value is deemed as empty
string
printInputSearchField(FieldInfos $fieldInfos, string $key, mixed $value, string $keyPrefix = '', string $keySuffix = '', string $moreCss = '', string $moreAttrib = '')
Return HTML string to put an input search field into a page
string
printInputField(FieldInfos $fieldInfos, string $key, mixed $value, string $keyPrefix = '', string $keySuffix = '', string $moreCss = '', string $moreAttrib = '')
Return HTML string to put an input field into a page
string
printOutputField(FieldInfos $fieldInfos, string $key, mixed $value, string $keyPrefix = '', string $keySuffix = '', string $moreCss = '', string $moreAttrib = '')
Return HTML string to show a field into a page
getInputCss($fieldInfos, $moreCss = '', $defaultCss = '')
Get input CSS
bool
verifyFieldValue(FieldInfos $fieldInfos, string $key, mixed $value)
Verify if the field value is valid
bool
verifyPostFieldValue(FieldInfos $fieldInfos, string $key, string $keyPrefix = '', string $keySuffix = '')
Verify if the field value from GET/POST is valid
mixed
getPostFieldValue(FieldInfos $fieldInfos, string $key, mixed $defaultValue = null, string $keyPrefix = '', string $keySuffix = '')
Get field value from GET/POST
mixed
getPostSearchFieldValue(FieldInfos $fieldInfos, string $key, mixed $defaultValue = null, string $keyPrefix = '', string $keySuffix = '')
Get search field value from GET/POST
sqlFilterSearchField($fieldInfos, $key, $value)
Get sql filter for search field
array{all: string, tableName: string, labelFullFields: string[], labelFields: string[], labelAlias: string[], keyField: string, parentName: string, parentFullField: string, parentField: string, parentAlias: string, filter: string, categoryType: string, categoryRoots: string, sortField: string}
getOptionsParams(array<string, mixed> $options)
Get all parameters in the options
array{field: string, alias: string}
getSqlFieldInfo(string $fullField)
Get sql info of the full field
array<string, array{label: string, parent: string}>|null
getOptions(FieldInfos $fieldInfos, string $key, bool $addEmptyValue = false, bool $reload = false, string|array<int, string> $selectedValues = array())
Get list of options