|
const | TABLE = 'field_types' |
|
const | PK = 'field_id' |
|
const | SEPARATOR = 0 |
|
const | TEXT = 1 |
|
const | LINE = 2 |
|
const | CHOICE = 3 |
|
const | DATE = 4 |
|
const | BOOLEAN = 5 |
|
const | FILE = 6 |
|
const | MOVE_UP = 'up' |
|
const | MOVE_DOWN = 'down' |
|
const | DEFAULT_MAX_FILE_SIZE = 1024 |
|
const | VALUES_FIELD_LENGTH = 100 |
|
|
bool | $has_data = false |
|
bool | $has_width = false |
|
bool | $has_height = false |
|
bool | $has_size = false |
|
bool | $has_min_size = false |
|
bool | $multi_valued = false |
|
bool | $fixed_values = false |
|
bool | $has_permissions = true |
|
int | $id = null |
|
int | $index = null |
|
bool | $required = false |
|
int | $width_in_forms = 1 |
|
bool | $information_above = false |
|
int | $width = null |
|
int | $height = null |
|
int | $repeat = null |
|
int | $min_size = null |
|
int | $size = null |
|
int | $old_size = null |
|
string array false | $values = false |
|
string | $form |
|
string | $information = null |
|
string | $name = null |
|
string | $old_name = null |
|
array | $errors = [] |
|
Db | $zdb |
|
Abstract dynamic field
- Author
- Johan Cwiklinski johan.nosp@m.@x-t.nosp@m.nd.be
◆ __construct()
Galette\DynamicFields\DynamicField::__construct |
( |
Db |
$zdb, |
|
|
mixed |
$args = null |
|
) |
| |
Default constructor
- Parameters
-
Db | $zdb | Database instance |
mixed | $args | Arguments |
◆ check()
Galette\DynamicFields\DynamicField::check |
( |
array |
$values | ) |
|
Check posted values validity
- Parameters
-
array<string,mixed> | $values All values to check, basically the $_POST array after sending the form |
- Returns
- bool
◆ getErrors()
Galette\DynamicFields\DynamicField::getErrors |
( |
| ) |
|
Get errors
- Returns
- array<string>
◆ getFieldsTypesNames()
static Galette\DynamicFields\DynamicField::getFieldsTypesNames |
( |
| ) |
|
|
static |
Retrieve fields types names
- Returns
- array<int, string>
◆ getFieldType()
static Galette\DynamicFields\DynamicField::getFieldType |
( |
Db |
$zdb, |
|
|
int |
$t, |
|
|
int |
$id = null |
|
) |
| |
|
static |
Get correct field type instance
- Parameters
-
Db | $zdb | Database instance |
int | $t | Field type |
int | null | $id | Optional dynamic field id (to load data) |
- Returns
- DynamicField
◆ getFixedValuesTableName()
static Galette\DynamicFields\DynamicField::getFixedValuesTableName |
( |
int |
$id, |
|
|
bool |
$prefixed = false |
|
) |
| |
|
static |
Retrieve fixed values table name
- Parameters
-
integer | $id | Field ID |
bool | $prefixed | Whether table name should be prefixed |
- Returns
- string
◆ getForm()
Galette\DynamicFields\DynamicField::getForm |
( |
| ) |
|
◆ getFormsNames()
static Galette\DynamicFields\DynamicField::getFormsNames |
( |
| ) |
|
|
static |
Retrieve forms names
- Returns
- array<string,string>
◆ getFormTitle()
static Galette\DynamicFields\DynamicField::getFormTitle |
( |
string |
$form_name | ) |
|
|
static |
Retrieve form name
- Parameters
-
string | $form_name | Form name |
- Returns
- string
◆ getHeight()
Galette\DynamicFields\DynamicField::getHeight |
( |
| ) |
|
Get field height
- Returns
- integer|null
◆ getId()
Galette\DynamicFields\DynamicField::getId |
( |
| ) |
|
Get field id
- Returns
- integer|null
◆ getIndex()
Galette\DynamicFields\DynamicField::getIndex |
( |
| ) |
|
Get field index
- Returns
- integer|null
◆ getInformation()
Galette\DynamicFields\DynamicField::getInformation |
( |
| ) |
|
Get field information
- Returns
- string
◆ getMinSize()
Galette\DynamicFields\DynamicField::getMinSize |
( |
| ) |
|
Get field min size
- Returns
- integer|null
◆ getNewIndex()
Galette\DynamicFields\DynamicField::getNewIndex |
( |
| ) |
|
|
protected |
Get new index
- Returns
- integer
◆ getRepeat()
Galette\DynamicFields\DynamicField::getRepeat |
( |
| ) |
|
Get fields repetitions
- Returns
- integer|null
◆ getSize()
Galette\DynamicFields\DynamicField::getSize |
( |
| ) |
|
Get field size
- Returns
- integer|null
◆ getType()
Galette\DynamicFields\DynamicField::getType |
( |
| ) |
|
|
abstract |
◆ getTypeName()
Galette\DynamicFields\DynamicField::getTypeName |
( |
| ) |
|
Get field type name
- Returns
- String
◆ getValues()
Galette\DynamicFields\DynamicField::getValues |
( |
bool |
$imploded = false | ) |
|
Get field values
- Parameters
-
bool | $imploded | Whether to implode values |
- Returns
- array<string>|string|false
◆ getWarnings()
Galette\DynamicFields\DynamicField::getWarnings |
( |
| ) |
|
Get warnings
- Returns
- array<string>
◆ getWidth()
Galette\DynamicFields\DynamicField::getWidth |
( |
| ) |
|
Get field width
- Returns
- integer|null
◆ getWidthInForms()
Galette\DynamicFields\DynamicField::getWidthInForms |
( |
| ) |
|
Get field's width in forms
- Returns
- integer|null
◆ hasData()
Galette\DynamicFields\DynamicField::hasData |
( |
| ) |
|
Does the field handle data?
- Returns
- bool
◆ hasFixedValues()
Galette\DynamicFields\DynamicField::hasFixedValues |
( |
| ) |
|
Does the field has fixed values?
- Returns
- bool
◆ hasHeight()
Galette\DynamicFields\DynamicField::hasHeight |
( |
| ) |
|
Does the field has height?
- Returns
- bool
◆ hasInformationAbove()
Galette\DynamicFields\DynamicField::hasInformationAbove |
( |
| ) |
|
Does the field information have to be displayed above input?
- Returns
- bool
◆ hasMinSize()
Galette\DynamicFields\DynamicField::hasMinSize |
( |
| ) |
|
Does the field has min size?
- Returns
- bool
◆ hasPermissions()
Galette\DynamicFields\DynamicField::hasPermissions |
( |
| ) |
|
Does the field require permissions?
- Returns
- bool
◆ hasSize()
Galette\DynamicFields\DynamicField::hasSize |
( |
| ) |
|
Does the field has a size?
- Returns
- bool
◆ hasWidth()
Galette\DynamicFields\DynamicField::hasWidth |
( |
| ) |
|
Does the field has width?
- Returns
- bool
◆ isDuplicate()
Galette\DynamicFields\DynamicField::isDuplicate |
( |
| ) |
|
Is field duplicated?
- Returns
- bool
◆ isMultiValued()
Galette\DynamicFields\DynamicField::isMultiValued |
( |
| ) |
|
Is the field multivalued?
- Returns
- bool
◆ isRepeatable()
Galette\DynamicFields\DynamicField::isRepeatable |
( |
| ) |
|
Is current field repeatable?
- Returns
- bool
◆ isRequired()
Galette\DynamicFields\DynamicField::isRequired |
( |
| ) |
|
Is field required?
- Returns
- bool
◆ loadFromRS()
Galette\DynamicFields\DynamicField::loadFromRS |
( |
ArrayObject |
$rs, |
|
|
bool |
$values = true |
|
) |
| |
Load field type from a db ResultSet
- Parameters
-
| ArrayObject<string,int|string> | $rs ResultSet |
bool | $values | Whether to load values. Defaults to true |
- Returns
- void
◆ move()
Galette\DynamicFields\DynamicField::move |
( |
string |
$action | ) |
|
Move a dynamic field
- Parameters
-
string | $action | What to do (one of self::MOVE_*) |
- Returns
- bool
◆ remove()
Galette\DynamicFields\DynamicField::remove |
( |
| ) |
|
Delete a dynamic field
- Returns
- bool
◆ store()
Galette\DynamicFields\DynamicField::store |
( |
array |
$values | ) |
|
Store the field type
- Parameters
-
array<string,mixed> | $values All values to check, basically the $_POST array after sending the form |
- Returns
- bool
◆ BOOLEAN
const Galette\DynamicFields\DynamicField::BOOLEAN = 5 |
◆ CHOICE
const Galette\DynamicFields\DynamicField::CHOICE = 3 |
◆ DATE
const Galette\DynamicFields\DynamicField::DATE = 4 |
◆ FILE
const Galette\DynamicFields\DynamicField::FILE = 6 |
◆ LINE
const Galette\DynamicFields\DynamicField::LINE = 2 |
◆ SEPARATOR
const Galette\DynamicFields\DynamicField::SEPARATOR = 0 |
◆ TEXT
const Galette\DynamicFields\DynamicField::TEXT = 1 |
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/galette-apidoc/checkouts/develop/galette/lib/Galette/DynamicFields/DynamicField.php