Galette API documentation
Gestionnaire d’Adhérents en Ligne Extrêmement Tarabiscoté mais Tellement Efficace
1.0.0
Galette\DynamicFields\DynamicField Class Reference
Inheritance diagram for Galette\DynamicFields\DynamicField:
Collaboration diagram for Galette\DynamicFields\DynamicField:

Public Member Functions

 __construct (Db $zdb, mixed $args=null)
 
 loadFromRS (ArrayObject $rs, bool $values=true)
 
 getType ()
 
 getTypeName ()
 
 hasData ()
 
 hasWidth ()
 
 hasHeight ()
 
 hasMinSize ()
 
 hasSize ()
 
 isMultiValued ()
 
 hasFixedValues ()
 
 hasPermissions ()
 
 getId ()
 
 isRequired ()
 
 getWidthInForms ()
 
 getWidth ()
 
 getHeight ()
 
 isRepeatable ()
 
 getRepeat ()
 
 getMinSize ()
 
 getSize ()
 
 getIndex ()
 
 getInformation ()
 
 hasInformationAbove ()
 
 getForm ()
 
 getValues (bool $imploded=false)
 
 check (array $values)
 
 store (array $values)
 
 isDuplicate ()
 
 move (string $action)
 
 remove ()
 
 getErrors ()
 
 getWarnings ()
 

Static Public Member Functions

static getFieldType (Db $zdb, int $t, int $id=null)
 
static getFixedValuesTableName (int $id, bool $prefixed=false)
 
static getFormsNames ()
 
static getFormTitle (string $form_name)
 
static getFieldsTypesNames ()
 

Public Attributes

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
 

Protected Member Functions

 getNewIndex ()
 

Protected Attributes

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
 

Detailed Description

Abstract dynamic field

Author
Johan Cwiklinski johan.nosp@m.@x-t.nosp@m.nd.be

Constructor & Destructor Documentation

◆ __construct()

Galette\DynamicFields\DynamicField::__construct ( Db  $zdb,
mixed  $args = null 
)

Default constructor

Parameters
Db$zdbDatabase instance
mixed$argsArguments

Member Function Documentation

◆ 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$zdbDatabase instance
int$tField type
int | null$idOptional 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$idField ID
bool$prefixedWhether table name should be prefixed
Returns
string

◆ getForm()

Galette\DynamicFields\DynamicField::getForm ( )

Get form

Returns
string

◆ 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_nameForm 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()

◆ getTypeName()

Galette\DynamicFields\DynamicField::getTypeName ( )

Get field type name

Returns
String

◆ getValues()

Galette\DynamicFields\DynamicField::getValues ( bool  $imploded = false)

Get field values

Parameters
bool$implodedWhether 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$valuesWhether to load values. Defaults to true
Returns
void

◆ move()

Galette\DynamicFields\DynamicField::move ( string  $action)

Move a dynamic field

Parameters
string$actionWhat 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

Member Data Documentation

◆ BOOLEAN

const Galette\DynamicFields\DynamicField::BOOLEAN = 5

Boolean field (checkbox)

◆ CHOICE

const Galette\DynamicFields\DynamicField::CHOICE = 3

Choice field (listbox)

◆ DATE

const Galette\DynamicFields\DynamicField::DATE = 4

Date field

◆ FILE

const Galette\DynamicFields\DynamicField::FILE = 6

File field (upload)

◆ LINE

const Galette\DynamicFields\DynamicField::LINE = 2

Line field

◆ SEPARATOR

const Galette\DynamicFields\DynamicField::SEPARATOR = 0

Separator field

◆ TEXT

const Galette\DynamicFields\DynamicField::TEXT = 1

Simple text field


The documentation for this class was generated from the following file: