Orion PHP  0.11.12
The PHP5.3 framework
Orion\Core\Model\Field Class Reference
+ Inheritance diagram for Orion\Core\Model\Field:

List of all members.

Public Member Functions

 getLabel ()
 getType ()
 getBinding ()
 getName ()
 getValue ()
 setValue ($val)
 setVisibility ($bool)
 isEmptyValue ($value)
 isLinked ()
 isMultipart ()
 isPrimary ()
 isRequired ()
 isVisible ()
 prepare ($value)
 validate ($value)
 __toString ()
 toHtml ($XHTML=true)

Protected Attributes

 $visible = true
 $linked = false
 $multipart = false
 $value
 $type
 $bind
 $label = 'OrionField'
 $primary = false
 $required = false

Detailed Description

Base model field class.

Extend this abstract class when creating a new model field class. (Customfield extends Field). Be sure to specify at least $bind and $type attributes

Definition at line 11 of file field.php.


Member Function Documentation

Orion\Core\Model\Field::__toString ( )

Definition at line 204 of file field.php.

Orion\Core\Model\Field::getBinding ( )

Retreive field's binding (field ID)

Returns:
string

Definition at line 91 of file field.php.

Orion\Core\Model\Field::getLabel ( )

Retreive field's label

Returns:
string

Definition at line 72 of file field.php.

Orion\Core\Model\Field::getName ( )

Same as getBinding(), just a more common name. Retreive field's binding (field ID)

Returns:
string

Definition at line 100 of file field.php.

Orion\Core\Model\Field::getType ( )

Retreive field's type

Returns:
string

Definition at line 81 of file field.php.

Orion\Core\Model\Field::getValue ( )

Retreive field's value

Returns:
string

Definition at line 109 of file field.php.

Orion\Core\Model\Field::isEmptyValue ( value)

Check if the field's value is empty (override for specific cases)

Returns:
boolean

Reimplemented in Orion\Core\Model\Bool.

Definition at line 134 of file field.php.

Orion\Core\Model\Field::isLinked ( )

Check if the field is linked

Returns:
boolean

Definition at line 143 of file field.php.

Orion\Core\Model\Field::isMultipart ( )

Check if the field needs a multipart form type

Returns:
boolean

Definition at line 152 of file field.php.

Orion\Core\Model\Field::isPrimary ( )

Check if the field is a primary DB key

Returns:
boolean

Definition at line 161 of file field.php.

Orion\Core\Model\Field::isRequired ( )

Check if the field is required

Returns:
boolean

Definition at line 170 of file field.php.

Orion\Core\Model\Field::isVisible ( )

Check if the field is visible in form creation

Returns:
boolean

Definition at line 179 of file field.php.

Orion\Core\Model\Field::prepare ( value)

This method is called before every field value usage in DB transaction. Override this method to define a specific way of preparing the field value for DB insertion

Returns:
string

Reimplemented in Orion\Core\Model\String, Orion\Core\Model\Text, Orion\Core\Model\Image, Orion\Core\Model\Bool, Orion\Core\Model\Password, and Orion\Core\Model\Date.

Definition at line 189 of file field.php.

Orion\Core\Model\Field::setValue ( val)

Set field's value

Definition at line 117 of file field.php.

Orion\Core\Model\Field::setVisibility ( bool)

Set field's form visibility

Definition at line 125 of file field.php.

Orion\Core\Model\Field::toHtml ( XHTML = true)

This method is called before DB deletion action. Override this method to define a specific pre-deletion behaviour

Parameters:
mixed$oldvalueThe old field value (before deletion occurs) This method is called before DB insertion action Override this method to define a specific pre-insertion behaviour
mixed$valueThe new field value (before insertion occurs) This method is called before DB update action Override this method to define a specific pre-update behaviour
mixed$oldvalueThe old field value (before update occurs)
mixed$valueThe new field value (before update occurs) Override this function to define a specific (x)HTML form field to use during model-to-form translation. By default, this function returns a hidden form field.
boolean$XHTML
Returns:
string

Reimplemented in Orion\Core\Model\Image, Orion\Core\Model\String, Orion\Core\Model\Tags, Orion\Core\Model\Link, Orion\Core\Model\Text, Orion\Core\Model\Numeric, Orion\Core\Model\Date, Orion\Core\Model\Bool, Orion\Core\Model\Password, Orion\Core\Model\Select, Orion\Core\Model\Integer, Orion\Core\Model\Id, Orion\Core\Model\LinkOneMany, and Orion\Core\Model\LinkOneOne.

Definition at line 246 of file field.php.

Orion\Core\Model\Field::validate ( value)

This method is called before every field value usage in DB transaction. Override this method to use a specific value validation process for DB insertion

Returns:
boolean

Reimplemented in Orion\Core\Model\Numeric, Orion\Core\Model\String, and Orion\Core\Model\Text.

Definition at line 199 of file field.php.


Member Data Documentation

Orion::Core::Model\Field::$bind [protected]

Definition at line 48 of file field.php.

Orion::Core::Model\Field::$label = 'OrionField' [protected]

Definition at line 54 of file field.php.

Orion::Core::Model\Field::$linked = false [protected]

Definition at line 24 of file field.php.

Orion::Core::Model\Field::$multipart = false [protected]

Definition at line 30 of file field.php.

Orion::Core::Model\Field::$primary = false [protected]

Definition at line 60 of file field.php.

Orion::Core::Model\Field::$required = false [protected]

Reimplemented in Orion\Core\Model\Tags.

Definition at line 66 of file field.php.

Orion::Core::Model\Field::$type [protected]

Definition at line 42 of file field.php.

Orion::Core::Model\Field::$value [protected]

Definition at line 36 of file field.php.

Orion::Core::Model\Field::$visible = true [protected]

Definition at line 18 of file field.php.


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