PHP Class Pop\Form\Fields

Author: Nick Sagona, III ([email protected])
Inheritance: implements ArrayAccess
ファイルを表示 Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$fields array Fields array

Public Methods

Method Description
__construct ( mixed $fields = null, array $attribs = null, array $values = null, mixed $omit = null ) : Fields Constructor
__get ( string $name ) : mixed Get method to return the value of fields[$name].
__isset ( string $name ) : boolean Return the isset value of fields[$name].
__set ( string $name, mixed $value ) : void Set method to set the property to the value of fields[$name].
__unset ( string $name ) : void Unset fields[$name].
addFields ( array $fields ) : Fields Add form fields
addFieldsFromTable ( array $tableInfo, array $attribs = null, array $values = null, mixed $omit = null ) : Fields Add form fields from a related database table. The $tableInfo parameter should be the returned array result from calling the static Pop\Db\Record method, Record::getTableInfo();
factory ( mixed $fields = null, array $attribs = null, array $values = null, mixed $omit = null ) : Fields Static method to instantiate the fields object and return itself to facilitate chaining methods together.
getFields ( ) : array Get the form fields
setField ( string $field, mixed $attrib, mixed $value = null ) : Fields Set form field

Method Details

__construct() public method

Instantiate the fields object
public __construct ( mixed $fields = null, array $attribs = null, array $values = null, mixed $omit = null ) : Fields
$fields mixed
$attribs array
$values array
$omit mixed
return Fields

__get() public method

Get method to return the value of fields[$name].
public __get ( string $name ) : mixed
$name string
return mixed

__isset() public method

Return the isset value of fields[$name].
public __isset ( string $name ) : boolean
$name string
return boolean

__set() public method

Set method to set the property to the value of fields[$name].
public __set ( string $name, mixed $value ) : void
$name string
$value mixed
return void

__unset() public method

Unset fields[$name].
public __unset ( string $name ) : void
$name string
return void

addFields() public method

Add form fields
public addFields ( array $fields ) : Fields
$fields array
return Fields

addFieldsFromTable() public method

Add form fields from a related database table. The $tableInfo parameter should be the returned array result from calling the static Pop\Db\Record method, Record::getTableInfo();
public addFieldsFromTable ( array $tableInfo, array $attribs = null, array $values = null, mixed $omit = null ) : Fields
$tableInfo array
$attribs array
$values array
$omit mixed
return Fields

factory() public static method

Static method to instantiate the fields object and return itself to facilitate chaining methods together.
public static factory ( mixed $fields = null, array $attribs = null, array $values = null, mixed $omit = null ) : Fields
$fields mixed
$attribs array
$values array
$omit mixed
return Fields

getFields() public method

Get the form fields
public getFields ( ) : array
return array

setField() public method

Set form field
public setField ( string $field, mixed $attrib, mixed $value = null ) : Fields
$field string
$attrib mixed
$value mixed
return Fields

Property Details

$fields protected_oe property

Fields array
protected array $fields
return array