nyroFwk  0.2
Public Member Functions | Protected Member Functions | Protected Attributes
form_db Class Reference
Inheritance diagram for form_db:
form object

Public Member Functions

 addFromField (array $field, $isI18n=false)
 
 addFromRelated (array $related)
 
 addFromFieldFilter (array $field)
 
 addFromRelatedFilter (array $related)
 
 getFromFieldPrm (array $field)
 
 setSubmitText ($text)
 
 setSubmitPlus ($text)
 
 __toString ()
 
 to ($type)
 
 finalize ()
 
 toHtml ()
 
 toXul ()
 
 isValid ()
 
 isI18n ()
 
 getErrors ()
 
 hasErrors ()
 
 addCustomError ($field, $error)
 
 add ($type, array $prm=array(), $isI18n=false)
 
 has ($name)
 
 get ($name)
 
 del ($name)
 
 reOrder (array $order)
 
 reOrderSection (array $order)
 
 getValue ($name)
 
 getValues ($onlyFilled=false, $ignoreWhitePassword=true)
 
 addNotValue ($name)
 
 getNames ()
 
 setValue ($name, $value, $refill=false)
 
 setValues (array $data, $refill=false)
 
 isBound ()
 
 setBound ($bound)
 
 refill ()
 
 getNew ($type, array $prm)
 
 addSection ($name)
 
 setSection ($search)
 
 setSectionName ($name, $search=null)
 
 moveToSection ($name, $section=null)
 
 setMode ($mode, $force=true)
 
 firstSection ()
 
 lastSection ()
 
 getSection ()
 
 addCaptcha ()
 
 set ($key1, $key2, $val)
 
 __set ($key, $val)
 
 __clone ()
 
 getAttr ($name)
 
 setAttr ($name, $value)
 
 getCfg ()
 

Protected Member Functions

 afterInit ()
 
 beforeInit ()
 

Protected Attributes

 $elements = array()
 
 $i18nElements = array()
 
 $section = array()
 
 $elementsSection = array()
 
 $curSection = 0
 
 $hasFiles = 0
 
 $isBound = false
 
 $errors = array()
 
 $customErrors = array()
 
 $captchaAdded = false
 
 $cfg
 

Detailed Description

class for create form directly from the db fields

Definition at line 10 of file form/db.class.php.

Member Function Documentation

◆ __clone()

__clone ( )
inherited

Used when cloning the form to create new field element

Definition at line 768 of file form.class.php.

◆ __set()

__set (   $key,
  $val 
)
inherited

Definition at line 761 of file form.class.php.

◆ __toString()

__toString ( )
inherited

Transform the element to a string to be shown, with the courant output

Returns
string

Definition at line 112 of file form.class.php.

◆ add()

add (   $type,
array  $prm = array(),
  $isI18n = false 
)
inherited

Add a form element in the current section

Parameters
string | form_abstract$typeForm element type or element form
array$prmParameter array for the element
bool$isI18n
Returns
form_abstract|null Reference to the added element or null if not added or i18n (name exist yet)

Definition at line 343 of file form.class.php.

◆ addCaptcha()

addCaptcha ( )
inherited

Add a captcha if parametred and not already added

Definition at line 740 of file form.class.php.

◆ addCustomError()

addCustomError (   $field,
  $error 
)
inherited

Add a custom error

Parameters
string$fieldFiled name to be associate with
string$errorThe error text

Definition at line 325 of file form.class.php.

◆ addFromField()

addFromField ( array  $field,
  $isI18n = false 
)

Add a form element regarding the field information

Parameters
array$fieldField information
bool$isI18n
Returns
form_abstract Reference to the new element

Definition at line 19 of file form/db.class.php.

◆ addFromFieldFilter()

addFromFieldFilter ( array  $field)

Add a form element regarding the field information, especially for a filter

Parameters
array$fieldField information
Returns
form_abstract Reference to the new element

Definition at line 67 of file form/db.class.php.

◆ addFromRelated()

addFromRelated ( array  $related)

Add a form element for a related filter

Parameters
array$related

Definition at line 29 of file form/db.class.php.

◆ addFromRelatedFilter()

addFromRelatedFilter ( array  $related)

Add a form element for a related filter, especially for a filter

Parameters
array$related

Definition at line 123 of file form/db.class.php.

◆ addNotValue()

addNotValue (   $name)
inherited

Add field to be considered as a non value (ie non attribued in getValues)

Parameters
string$name

Definition at line 525 of file form.class.php.

◆ addSection()

addSection (   $name)
inherited

Add a new section

Parameters
string$nameSection name
Returns
int The section index

Definition at line 623 of file form.class.php.

◆ afterInit()

afterInit ( )
protectedinherited

Add the first section from the configuration file

Definition at line 85 of file form.class.php.

◆ beforeInit()

beforeInit ( )
protectedinherited

Call just before the configuration initialisation

Definition at line 35 of file object.class.php.

◆ del()

del (   $name)
inherited

Delete a form element

Parameters
string$name

Definition at line 395 of file form.class.php.

◆ finalize()

finalize ( )
inherited

Finalize the construction of the form. Should be call when i18n are present

Definition at line 220 of file form.class.php.

◆ firstSection()

firstSection ( )
inherited

Set the section to the first

Definition at line 717 of file form.class.php.

◆ get()

get (   $name)
inherited

Get a form element

Parameters
string$nameField name
Returns
form_abstract|null

Definition at line 384 of file form.class.php.

◆ getAttr()

getAttr (   $name)
inherited

Get an attribute

Parameters
string$nameAttribute name
Returns
mixed|null The attribute or null if not set

Definition at line 48 of file object.class.php.

◆ getCfg()

getCfg ( )
inherited

Get the configuration object

Returns
config

Definition at line 67 of file object.class.php.

◆ getErrors()

getErrors ( )
inherited

Get all the errors for the last validation

Returns
array

Definition at line 306 of file form.class.php.

◆ getFromFieldPrm()

getFromFieldPrm ( array  $field)

Get a form element array parameter regarding the field information

Parameters
array$fieldField information
Returns
form_abstract Reference to the new element

Definition at line 154 of file form/db.class.php.

◆ getNames()

getNames ( )
inherited

Get all the available names

Returns
array

Definition at line 534 of file form.class.php.

◆ getNew()

getNew (   $type,
array  $prm 
)
inherited

Get a form element for the form type

Parameters
string$typeForm element type
array$prmParameter array for the element
Returns
form_abstract Reference to the new element

Definition at line 611 of file form.class.php.

◆ getSection()

getSection ( )
inherited

Get the current section index

Returns
int

Definition at line 733 of file form.class.php.

◆ getValue()

getValue (   $name)
inherited

Get the actual value for 1 field

Parameters
string$nameField name
Returns
mixed

Definition at line 469 of file form.class.php.

◆ getValues()

getValues (   $onlyFilled = false,
  $ignoreWhitePassword = true 
)
inherited

Get all the values field

Parameters
bool$onlyFilled
bool$ignoreWhitePassword
Returns
array

Definition at line 483 of file form.class.php.

◆ has()

has (   $name)
inherited

Check if the form has a element

Parameters
string$nameField name
Returns
bool

Definition at line 374 of file form.class.php.

◆ hasErrors()

hasErrors ( )
inherited

Check if the form has errors (only if a validations was done)

Returns
bool

Definition at line 315 of file form.class.php.

◆ isBound()

isBound ( )
inherited

Indicates if the form has been bound

Returns
boolean

Definition at line 576 of file form.class.php.

◆ isI18n()

isI18n ( )
inherited

Indicate if the form has i18n elements

Returns
bool

Definition at line 297 of file form.class.php.

◆ isValid()

isValid ( )
inherited

Check if all the form elements are valid

Returns
bool True if valid

Definition at line 278 of file form.class.php.

◆ lastSection()

lastSection ( )
inherited

Set the section to the last

Definition at line 724 of file form.class.php.

◆ moveToSection()

moveToSection (   $name,
  $section = null 
)
inherited

Move a field to another section

Parameters
string$nameFieldname
int$sectionSection Number. If null, current section will be used
Returns
bool True if the field was found and moved

Definition at line 686 of file form.class.php.

◆ refill()

refill ( )
inherited

Refill the whole form from the post argument

Definition at line 592 of file form.class.php.

◆ reOrder()

reOrder ( array  $order)
inherited

Reorder the fields in the current section

Parameters
array$orderArray containing the field names in order wanted

Definition at line 407 of file form.class.php.

◆ reOrderSection()

reOrderSection ( array  $order)
inherited

Reorder the sections

Parameters
array$orderArray containing either the section index or the section name

Definition at line 428 of file form.class.php.

◆ set()

set (   $key1,
  $key2,
  $val 
)
inherited

Set configuration var with a depth of 2

Parameters
string$key1The 1st index
string$key2The 2nd index
mixed$valThe value

Definition at line 757 of file form.class.php.

◆ setAttr()

setAttr (   $name,
  $value 
)
inherited

Set an attribute

Parameters
string$nameAttribute name
mixed$valueAttribute value

Definition at line 58 of file object.class.php.

◆ setBound()

setBound (   $bound)
inherited

Set the bound status

Parameters
boolean$bound

Definition at line 585 of file form.class.php.

◆ setMode()

setMode (   $mode,
  $force = true 
)
inherited

Change the mode of the form

Parameters
string$modeedit or view
bool$forceTrue to reaffect all the field

Definition at line 705 of file form.class.php.

◆ setSection()

setSection (   $search)
inherited

Set the current section

Parameters
int | string$searchSection index or section name
Returns
false|int Section index if found or false

Definition at line 636 of file form.class.php.

◆ setSectionName()

setSectionName (   $name,
  $search = null 
)
inherited

Set a section name

Parameters
string$nameSection name to set
null | int | string$searchnull to set to the current section, int or string to search a section
Returns
bool True if section name was correctly set

Definition at line 659 of file form.class.php.

◆ setSubmitPlus()

setSubmitPlus (   $text)
inherited

Set the submit plus

Parameters
string$text

Definition at line 103 of file form.class.php.

◆ setSubmitText()

setSubmitText (   $text)
inherited

Set the submit text

Parameters
string$text

Definition at line 94 of file form.class.php.

◆ setValue()

setValue (   $name,
  $value,
  $refill = false 
)
inherited

Set a field value

Parameters
string$nameField name
mixed$value
boolean$refillIndicate if the value is a refill one
Returns
bool True if successful

Definition at line 546 of file form.class.php.

◆ setValues()

setValues ( array  $data,
  $refill = false 
)
inherited

Set values to the form elements

Parameters
array$data
boolean$refillIndicate if the value is a refill one
Returns
int Element values updated count

Definition at line 562 of file form.class.php.

◆ to()

to (   $type)
inherited

Transform the element to a string to be shown

Parameters
string$typeThe output type
Returns
string

Definition at line 129 of file form.class.php.

◆ toHtml()

toHtml ( )
inherited

Transform the form in HTML

Definition at line 262 of file form.class.php.

◆ toXul()

toXul ( )
inherited

Transform the form in XUL

Definition at line 269 of file form.class.php.

Field Documentation

◆ $captchaAdded

$captchaAdded = false
protectedinherited

Definition at line 80 of file form.class.php.

◆ $cfg

$cfg
protectedinherited

Definition at line 17 of file object.class.php.

◆ $curSection

$curSection = 0
protectedinherited

Definition at line 45 of file form.class.php.

◆ $customErrors

$customErrors = array()
protectedinherited

Definition at line 73 of file form.class.php.

◆ $elements

$elements = array()
protectedinherited

Definition at line 17 of file form.class.php.

◆ $elementsSection

$elementsSection = array()
protectedinherited

Definition at line 38 of file form.class.php.

◆ $errors

$errors = array()
protectedinherited

Definition at line 66 of file form.class.php.

◆ $hasFiles

$hasFiles = 0
protectedinherited

Definition at line 52 of file form.class.php.

◆ $i18nElements

$i18nElements = array()
protectedinherited

Definition at line 24 of file form.class.php.

◆ $isBound

$isBound = false
protectedinherited

Definition at line 59 of file form.class.php.

◆ $section

$section = array()
protectedinherited

Definition at line 31 of file form.class.php.


The documentation for this class was generated from the following file:
Generated on Sun Oct 15 2017 22:25:20 for nyroFwk by doxygen 1.8.13