PHP Trait Formo_ORM

Afficher le fichier Open project: bmidget/kohana-formo

Protected Properties

Свойство Type Description
$_foreign_keys mixed (default value: [])
$_formo_alias mixed Optional formo alias for form

Méthodes publiques

Méthode Description
get_form ( array $fields, Formo $form = NULL ) : Formo Create a form from an ORM Model You can optionally pass a form to have fields added to
select_list ( mixed $result, mixed $key, mixed $value ) : array Utility method that just creates a array suitable for Formo opts from a result set

Méthodes protégées

Méthode Description
_field_exists ( $column )
_find_foreign_keys ( ) : void Fills $this->_foreign_keys in order to easier find foreign keys in all the process_type methods
_get_base_rules ( ) : array Apply rules based on mysql field definitions While you can skip these, it's a good idea to include them in your fields
_get_field_name ( ORM $model ) : string Convenience method for fetching the field name of a foreign model Formo allows
_process_belongs_to ( mixed $field_name, array &$options ) : void Add options to belongs_to fields
_process_enum ( mixed $field_name, array &$options ) : void Set up options for enum fields
_process_has_one ( mixed $field_name, array &$options ) : void Set up options for has_one relationships
_process_set ( mixed $field_name, array &$options ) : void Set up options for set fields
formo ( mixed $form ) : void Post-production after get_form

Method Details

_field_exists() protected méthode

protected _field_exists ( $column )

_find_foreign_keys() protected méthode

Fills $this->_foreign_keys in order to easier find foreign keys in all the process_type methods
protected _find_foreign_keys ( ) : void
Résultat void

_get_base_rules() protected méthode

Apply rules based on mysql field definitions While you can skip these, it's a good idea to include them in your fields
protected _get_base_rules ( ) : array
Résultat array

_get_field_name() protected static méthode

Convenience method for fetching the field name of a foreign model Formo allows
protected static _get_field_name ( ORM $model ) : string
$model ORM
Résultat string

_process_belongs_to() protected méthode

Add options to belongs_to fields
protected _process_belongs_to ( mixed $field_name, array &$options ) : void
$field_name mixed
$options array
Résultat void

_process_enum() protected méthode

Set up options for enum fields
protected _process_enum ( mixed $field_name, array &$options ) : void
$field_name mixed
$options array
Résultat void

_process_has_one() protected méthode

Set up options for has_one relationships
protected _process_has_one ( mixed $field_name, array &$options ) : void
$field_name mixed
$options array
Résultat void

_process_set() protected méthode

Set up options for set fields
protected _process_set ( mixed $field_name, array &$options ) : void
$field_name mixed
$options array
Résultat void

formo() protected méthode

Post-production after get_form
protected formo ( mixed $form ) : void
$form mixed
Résultat void

get_form() public méthode

Create a form from an ORM Model You can optionally pass a form to have fields added to
public get_form ( array $fields, Formo $form = NULL ) : Formo
$fields array (default: NULL)
$form Formo (default: NULL)
Résultat Formo

select_list() public static méthode

Utility method that just creates a array suitable for Formo opts from a result set
public static select_list ( mixed $result, mixed $key, mixed $value ) : array
$result mixed
$key mixed
$value mixed
Résultat array

Property Details

$_foreign_keys protected_oe property

(default value: [])
protected mixed $_foreign_keys
Résultat mixed

$_formo_alias protected_oe property

Optional formo alias for form
protected mixed $_formo_alias
Résultat mixed