class LinestrgField extends CommonGeoField (View source)

Class to linestrg field

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 from  CommonGeoField

Methods

__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

Details

__construct(DoliDB $db)

Constructor

Parameters

DoliDB $db

Database handler

static void setForm(Form $form)

Set form used for print the field

Parameters

Form $form

Form handler

Return Value

void

static void setValidator(Validate $validator)

Set validator used for check the field value

Parameters

Validate $validator

Validate handler

Return Value

void

void clearErrors()

clear errors

Return Value

void

string errorsToString(string $separator = ', ')

Method to output saved errors

Parameters

string $separator

Separator between each error

Return Value

string

String with errors

bool isEmptyValue(FieldInfos $fieldInfos, mixed $value, array<int, mixed> $emptyValues = null)

Check if the value is deemed as empty

Parameters

FieldInfos $fieldInfos

Properties of the field

mixed $value

Value to check (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array)

array<int, mixed> $emptyValues

List of value deemed as empty

Return Value

bool

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

Parameters

FieldInfos $fieldInfos

Properties of the field

string $key

Key of field

mixed $value

Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array)

string $keyPrefix

Prefix string to add into name and id of field (can be used to avoid duplicate names)

string $keySuffix

Suffix string to add into name and id of field (can be used to avoid duplicate names)

string $moreCss

Value for css to define style/length of field.

string $moreAttrib

To add more attributes on html input tag

Return Value

string

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

Parameters

FieldInfos $fieldInfos

Properties of the field

string $key

Key of field

mixed $value

Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array)

string $keyPrefix

Prefix string to add into name and id of field (can be used to avoid duplicate names)

string $keySuffix

Suffix string to add into name and id of field (can be used to avoid duplicate names)

string $moreCss

Value for css to define style/length of field.

string $moreAttrib

To add more attributes on html input tag

Return Value

string

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

Parameters

FieldInfos $fieldInfos

Properties of the field

string $key

Key of field

mixed $value

Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array)

string $keyPrefix

Prefix string to add into name and id of field (can be used to avoid duplicate names)

string $keySuffix

Suffix string to add into name and id of field (can be used to avoid duplicate names)

string $moreCss

Value for css to define style/length of field.

string $moreAttrib

To add more attributes on html input tag

Return Value

string

getInputCss($fieldInfos, $moreCss = '', $defaultCss = '')

Get input CSS

Parameters

$fieldInfos
$moreCss
$defaultCss

bool verifyFieldValue(FieldInfos $fieldInfos, string $key, mixed $value)

Verify if the field value is valid

Parameters

FieldInfos $fieldInfos

Properties of the field

string $key

Key of field

mixed $value

Value to check (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array)

Return Value

bool

See also

\self::printInputField()

bool verifyPostFieldValue(FieldInfos $fieldInfos, string $key, string $keyPrefix = '', string $keySuffix = '')

Verify if the field value from GET/POST is valid

Parameters

FieldInfos $fieldInfos

Properties of the field

string $key

Key of field

string $keyPrefix

Prefix string to add into name and id of field (can be used to avoid duplicate names)

string $keySuffix

Suffix string to add into name and id of field (can be used to avoid duplicate names)

Return Value

bool

See also

\self::printInputField()

mixed getPostFieldValue(FieldInfos $fieldInfos, string $key, mixed $defaultValue = null, string $keyPrefix = '', string $keySuffix = '')

Get field value from GET/POST

Parameters

FieldInfos $fieldInfos

Properties of the field

string $key

Key of field

mixed $defaultValue

Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array)

string $keyPrefix

Prefix string to add into name and id of field (can be used to avoid duplicate names)

string $keySuffix

Suffix string to add into name and id of field (can be used to avoid duplicate names)

Return Value

mixed

See also

\self::printInputField()

mixed getPostSearchFieldValue(FieldInfos $fieldInfos, string $key, mixed $defaultValue = null, string $keyPrefix = '', string $keySuffix = '')

Get search field value from GET/POST

Parameters

FieldInfos $fieldInfos

Properties of the field

string $key

Key of field

mixed $defaultValue

Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array)

string $keyPrefix

Prefix string to add into name and id of field (can be used to avoid duplicate names)

string $keySuffix

Suffix string to add into name and id of field (can be used to avoid duplicate names)

Return Value

mixed

See also

\self::printInputSearchField()

sqlFilterSearchField($fieldInfos, $key, $value)

Get sql filter for search field

Parameters

$fieldInfos
$key
$value