Bouncy Melons 0.2
declarative style orm
Public Member Functions | Protected Attributes
Field Class Reference
Inheritance diagram for Field:
IField BoolField DateField DatetimeField IdField IntField PhoneField SetField StringField TextField TimeField

Public Member Functions

 __construct ($name, $title=null, $options=array(), $sqlType=null)
 
 getName ()
 
 getTitle ()
 
 getType ()
 
 getOption ($key)
 
 isRequired ()
 
 getSqlType ()
 
 beforeGet ($value)
 
 beforeRead ($value)
 
 beforeSet ($value)
 
 setOption ($key, $value)
 

Protected Attributes

 $name
 
 $title
 
 $sqlType
 
 $options = []
 

Detailed Description

Definition at line 8 of file Field.php.

Constructor & Destructor Documentation

__construct (   $name,
  $title = null,
  $options = array(),
  $sqlType = null 
)
Parameters
string$namefield name, should be latin lowercase, no spaces
string$titlehuman readable name, optional
type$optionsfield specific options, may vary for differect fied types, optional
type$sqlTypesql type which will be used to store field data, optional

possible options: bool required, any default

Implements IField.

Definition at line 25 of file Field.php.

Member Function Documentation

beforeGet (   $value)

invoked in Single::get(), hook for data modification

Parameters
string$value
\bm\ISingle$single
Returns
string or any other type

Implements IField.

Definition at line 88 of file Field.php.

beforeRead (   $value)

invoked in Single::read(), hook for data modification

Parameters
string$value
Returns
string or any other type

Implements IField.

Definition at line 106 of file Field.php.

beforeSet (   $value)

invoked in Single::set() which itselt used by Single::setData(), hook for data modification

Parameters
type$value
Returns
type

Implements IField.

Definition at line 115 of file Field.php.

getName ( )
Returns
string field name

Implements IField.

Definition at line 35 of file Field.php.

getOption (   $key)
Parameters
string$key
Returns
any field option by name

Implements IField.

Definition at line 62 of file Field.php.

getSqlType ( )
Returns
get sql type, lowercased

Definition at line 74 of file Field.php.

getTitle ( )
Returns
string human readable title

Definition at line 42 of file Field.php.

getType ( )

for serialization, to be used in filter forms

Returns
string

Definition at line 53 of file Field.php.

isRequired ( )

Definition at line 66 of file Field.php.

setOption (   $key,
  $value 
)

modify field-specific option

Parameters
string$key
any$value

Implements IField.

Definition at line 125 of file Field.php.

Field Documentation

$name
protected

Definition at line 10 of file Field.php.

$options = []
protected

Definition at line 13 of file Field.php.

$sqlType
protected

Definition at line 12 of file Field.php.

$title
protected

Definition at line 11 of file Field.php.


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