Class GP_Thing

Description

Located in /gp-includes/thing.php (line 2)


	
			
Direct descendents
Variable Summary
Method Summary
GP_Thing __construct ([ $fields = array()])
void after_create ()
void after_save ()
void all ([ $order = null])
void apply_default_conditions ( $conditions_str)
void coerce ( $thing)
mixed create ($args $args)
mixed create_and_select ($args $args)
void delete ()
void delete_all ([ $where = null])
void fields ()
void find ( $conditions, [ $order = null])
void find_many ( $conditions, [ $order = null])
void find_one ( $conditions, [ $order = null])
void force_false_to_null ( $value)
void found_rows ()
void get ( $thing_or_id)
void get_static ( $name, [ $default = null])
void has_static ( $name)
void like_escape_printf ( $s)
mixed many ()
void map ( $results)
void normalize_fields ( $args)
mixed one ()
void prepare ( $args)
void prepare_fields_for_create ( $args)
void prepare_fields_for_save ( $args)
void query ()
void reload ()
void restrict_fields ( $thing)
void save ([ $args = null])
void select_all_from_conditions_and_order ( $conditions, [ $order = null])
void set_fields ( $db_object)
void set_static ( $name,  $value)
void sql_condition_from_php_value ( $php_value)
void sql_from_conditions ( $conditions)
void sql_from_order ( $order_by, [ $order_how = ''])
void sql_limit_for_paging ( $page, [ $per_page = null])
void update ($data $data, [ $where = null])
void validate ()
scalar value ()
void __call ( $name,  $args)
Variables
static mixed $static_by_class = array() (line 13)
static mixed $validation_rules_by_class = array() (line 14)
mixed $errors = array() (line 7)
mixed $map_results = true (line 10)
mixed $non_db_field_names = array() (line 6)

Redefined in descendants as:
mixed $per_page = 30 (line 9)

Redefined in descendants as:
mixed $static = array() (line 11)
mixed $table = null (line 4)
mixed $validation_rules = null (line 8)
Methods
Constructor __construct (line 16)
GP_Thing __construct ([ $fields = array()])
  • $fields
after_create (line 298)
void after_create ()

Redefined in descendants as:
after_save (line 302)
void after_save ()

Redefined in descendants as:
all (line 69)

Retrieves all rows from this table

void all ([ $order = null])
  • $order
apply_default_conditions (line 399)
void apply_default_conditions ( $conditions_str)
  • $conditions_str
coerce (line 277)
void coerce ( $thing)
  • $thing
create (line 152)

Inserts a new row

  • return: the object corresponding to the inserted row or false on error
mixed create ($args $args)
  • $args $args: array associative array with fields as keys and values as values

Redefined in descendants as:
create_and_select (line 171)

Inserts a record and then selects it back based on the id

  • return: the selected object or false on error
mixed create_and_select ($args $args)
  • $args $args: array see create()
delete (line 210)
void delete ()
delete_all (line 214)
void delete_all ([ $where = null])
  • $where
fields (line 373)
void fields ()
find (line 136)
void find ( $conditions, [ $order = null])
  • $conditions
  • $order
find_many (line 128)
void find_many ( $conditions, [ $order = null])
  • $conditions
  • $order
find_one (line 132)
void find_one ( $conditions, [ $order = null])
  • $conditions
  • $order
force_false_to_null (line 369)
void force_false_to_null ( $value)
  • $value
found_rows (line 390)
void found_rows ()
get (line 192)
void get ( $thing_or_id)
  • $thing_or_id

Redefined in descendants as:
get_static (line 41)
void get_static ( $name, [ $default = null])
  • $name
  • $default
has_static (line 45)
void has_static ( $name)
  • $name
like_escape_printf (line 395)
void like_escape_printf ( $s)
  • $s
many (line 122)

Retrieves multiple rows from this table

For parameters description see BPDB::prepare()

  • return: an object, containing the selected row or false on error
mixed many ()
map (line 286)
void map ( $results)
  • $results
normalize_fields (line 236)

Normalizes an array with key-value pairs representing a GP_Thing object.

  • todo: Include default type handling. For example dates 0000-00-00 should be set to null
void normalize_fields ( $args)
  • $args

Redefined in descendants as:
now_in_mysql_format (line 265)
void now_in_mysql_format ()
one (line 87)

Retrieves a single row from this table

For parameters description see BPDB::prepare()

  • return: an object, containing the selected row or false on error
mixed one ()
prepare (line 106)
void prepare ( $args)
  • $args
prepare_fields_for_create (line 270)
void prepare_fields_for_create ( $args)
  • $args
prepare_fields_for_save (line 245)

Prepares for enetering the database an array with key-value pairs, preresenting a GP_Thing object.

void prepare_fields_for_save ( $args)
  • $args

Redefined in descendants as:
query (line 140)
void query ()
reload (line 76)

Reloads the object data from the database, based on its id

void reload ()
save (line 199)
void save ([ $args = null])
  • $args
select_all_from_conditions_and_order (line 350)
void select_all_from_conditions_and_order ( $conditions, [ $order = null])
  • $conditions
  • $order
set_fields (line 223)
void set_fields ( $db_object)
  • $db_object

Redefined in descendants as:
set_static (line 49)
void set_static ( $name,  $value)
  • $name
  • $value
sql_condition_from_php_value (line 306)
void sql_condition_from_php_value ( $php_value)
  • $php_value
sql_from_conditions (line 323)
void sql_from_conditions ( $conditions)
  • $conditions
sql_from_order (line 340)
void sql_from_order ( $order_by, [ $order_how = ''])
  • $order_by
  • $order_how
sql_limit_for_paging (line 383)
void sql_limit_for_paging ( $page, [ $per_page = null])
  • $page
  • $per_page
update (line 183)

Updates a single row

void update ($data $data, [ $where = null])
  • $data $data: array associative array with fields as keys and updated values as values
  • $where

Redefined in descendants as:
validate (line 363)
void validate ()
value (line 99)

Retrieves a single value from this table

For parameters description see BPDB::prepare()

  • return: the result of the query or false on error
scalar value ()
__call (line 53)
void __call ( $name,  $args)
  • $name
  • $args

Documentation generated on Fri, 18 May 2012 01:46:10 +0100 by phpDocumentor 1.4.3