tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Class: Form_Field_Select

Source Location: /form/fields/select/form_field_select.class.php

Class Form_Field_Select

Descendants
Child Class Description
Form_Field_Select_Multiple Represents select field with multiple choice

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Form_Field

Form_Field::$current_errors
Form_Field::$default_value
Form_Field::$html_value
Form_Field::$name
Form_Field::$potential_errors
Form_Field::$required
Form_Field::$type
Form_Field::$value

Inherited From Form_Field

Form_Field::__construct()
Constructor
Form_Field::accept_submit()
Accepts submit data
Form_Field::add_potential_error()
Adds potential error for the field
Form_Field::basic_check()
Performs basic check for validity
Form_Field::capture_submit()
Captures submit
Form_Field::clear_errors()
Clear current errors
Form_Field::get_default_value()
Returns default value
Form_Field::get_errors()
Return field's current errors
Form_Field::get_html_value()
Returns html_value
Form_Field::get_name()
Returns field name
Form_Field::get_potential_error()
Nonsense function. Candidate for removal
Form_Field::get_properties_array()
Returns array with field properties
Form_Field::get_required()
Returns if the field is required
Form_Field::get_type()
Returns type of the field (class name)
Form_Field::get_value()
Returns field's value
Form_Field::is_field_in_error()
Checks if field is in error
Form_Field::set_default_value()
Sets default value
Form_Field::set_error()
Sets field current error
Form_Field::set_html_value()
Sets html_value
Form_Field::set_name()
Sets field's name
Form_Field::set_required()
Sets will the field be required
Form_Field::set_to_default()
Set field's value to default value
Form_Field::set_value()
Sets field's value
Form_Field::translate_value_html2app()
Transfers data from html_value to value

Inherited From Tangra_Class

Tangra_Class::get_class_name()
Alias of get_class(). Exist because of historical reasons.
Tangra_Class::__set()
Overides PHP built-in method and just throws exception if called. Purpose - to "forbid" autosetting of nonexisting class properties.

[ Top ]
Property Summary
integer   $empty_value   Empty value
array   $options   Array that contains options

[ Top ]
Method Summary
Form_Field_Select   __construct()   Constructor
void   add_option()   Adds new option
boolean   basic_check()   Performs basic check for validity
unknown   get_empty_value()   Returns empty value
array   get_options()   Returns all options as array
array   get_properties_array()   Returns array with field properties
boolean   is_unique_value()   Checks if there is option with same value
void   set_empty_value()   Sets empty value
void   set_options()   Sets all options at once using array
void   set_option_selected()   marks option as selected
void   set_value()   Sets current value
void   translate_value_html2app()   Transfers data from html_value to value
void   _set_value()   Sets current value

[ Top ]
Properties
integer   $empty_value = NULL [line 44]

Empty value

API Tags:
Internal:  
Access:  protected


[ Top ]
array   $options = array() [line 37]

Array that contains options

API Tags:
Internal:  
Access:  protected


[ Top ]
Methods
Constructor __construct  [line 55]

  Form_Field_Select __construct( string $name, [integer $value = NULL], [boolean $required = false], [integer $empty_value = NULL]  )

Constructor

Parameters:
string   $name:  Name of the field
integer   $value:  Default value
boolean   $required:  Is field required. Default is false
integer   $empty_value:  Value of empty value


Redefinition of:
Form_Field::__construct()
Constructor

Redefined in descendants as:

[ Top ]
add_option  [line 89]

  void add_option( integer $value  )

Adds new option

Parameters:
integer   $value:  Value of the option

API Tags:
Access:  public

Information Tags:
Throws:  TE_Select_Value_Already_Exists

[ Top ]
basic_check  [line 131]

  boolean basic_check( )

Performs basic check for validity


API Tags:
Internal:  
Access:  public


Redefinition of:
Form_Field::basic_check()
Performs basic check for validity

Redefined in descendants as:

[ Top ]
get_empty_value  [line 78]

  unknown get_empty_value( )

Returns empty value


API Tags:
Access:  public


[ Top ]
get_options  [line 195]

  array get_options( )

Returns all options as array


API Tags:
Access:  public


[ Top ]
get_properties_array  [line 182]

  array get_properties_array( )

Returns array with field properties


API Tags:
Internal:  
Access:  public


Redefinition of:
Form_Field::get_properties_array()
Returns array with field properties

[ Top ]
is_unique_value  [line 235]

  boolean is_unique_value( integer $value  )

Checks if there is option with same value

Parameters:
integer   $value:  Value of the option

API Tags:
Internal:  
Access:  private


[ Top ]
set_empty_value  [line 68]

  void set_empty_value( integer $empty_value  )

Sets empty value

Parameters:
integer   $empty_value: 

API Tags:
Access:  public


[ Top ]
set_options  [line 113]

  void set_options( array $options_arr  )

Sets all options at once using array

Parameters:
array   $options_arr: 

API Tags:
Access:  public


[ Top ]
set_option_selected  [line 217]

  void set_option_selected( integer $value  )

marks option as selected

Parameters:
integer   $value:  Value of the option

API Tags:
Internal:  
Access:  private


[ Top ]
set_value  [line 170]

  void set_value( integer $value  )

Sets current value

Parameters:
integer   $value: 

API Tags:
Access:  public


Redefinition of:
Form_Field::set_value()
Sets field's value

Redefined in descendants as:

[ Top ]
translate_value_html2app  [line 253]

  void translate_value_html2app( )

Transfers data from html_value to value


API Tags:
Internal:  
Access:  protected


Redefinition of:
Form_Field::translate_value_html2app()
Transfers data from html_value to value

Redefined in descendants as:

[ Top ]
_set_value  [line 206]

  void _set_value( integer $value  )

Sets current value

Parameters:
integer   $value:  Value of the option

API Tags:
Internal:  
Access:  protected


[ Top ]