[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/gp-includes/ -> thing.php (summary)

Things: GP_Thing class

File Size: 666 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

GP_Thing:: (51 methods):
  __construct()
  get_static()
  has_static()
  set_static()
  all()
  reload()
  one()
  value()
  prepare()
  many()
  many_no_map()
  find_many()
  find_many_no_map()
  find_one()
  find()
  find_no_map()
  _no_map()
  map_no_map()
  map()
  query()
  create()
  create_and_select()
  update()
  get()
  save()
  delete()
  delete_all()
  delete_many()
  set_fields()
  normalize_fields()
  prepare_fields_for_save()
  now_in_mysql_format()
  prepare_fields_for_create()
  get_db_field_formats()
  coerce()
  after_create()
  after_save()
  after_delete()
  sql_condition_from_php_value()
  sql_from_conditions()
  sql_from_order()
  select_all_from_conditions_and_order()
  restrict_fields()
  validate()
  force_false_to_null()
  fields()
  sql_limit_for_paging()
  found_rows()
  like_escape_printf()
  apply_default_conditions()
  set_memory_limit()


Class: GP_Thing  - X-Ref

Core base class extended to register things.

__construct( $fields = array()   X-Ref
No description

get_static( $name, $default = null )   X-Ref
No description

has_static( $name )   X-Ref
No description

set_static( $name, $value )   X-Ref
No description

all( $order = null )   X-Ref
Retrieves all rows from this table


reload()   X-Ref
Reloads the object data from the database, based on its id


one()   X-Ref
Retrieves a single row from this table

For parameters description see BPDB::prepare()
return: mixed an object, containing the selected row or false on error

value()   X-Ref
Retrieves a single value from this table

For parameters description see BPDB::prepare()
return: scalar the result of the query or false on error

prepare( $args )   X-Ref
No description

many()   X-Ref
Retrieves multiple rows from this table

For parameters description see `$wpdb->prepare()`.

since: 1.0.0
return: mixed An object, containing the selected row or false on error.

many_no_map()   X-Ref
[many_no_map description]

since: 1.0.0
return: mixed

find_many( $conditions, $order = null )   X-Ref
[find_many description]

since: 1.0.0
return: mixed
param: string|array $conditions
param: string|array $order Optional.

find_many_no_map( $conditions, $order = null )   X-Ref
[find_many_no_map description]

since: 1.0.0
return: mixed
param: string|array $conditions
param: string|array $order Optional.

find_one( $conditions, $order = null )   X-Ref
[find_one description]

since: 1.0.0
return: mixed
param: string|array $conditions
param: string|array $order Optional.

find( $conditions, $order = null )   X-Ref
[find description]

since: 1.0.0
return: mixed
param: string|array $conditions
param: string|array $order Optional.

find_no_map( $conditions, $order = null )   X-Ref
[find_no_map description]

since: 1.0.0
return: mixed
param: string|array $conditions
param: string|array $order Optional.

_no_map( $name, $args )   X-Ref
[_no_map description]

since: 1.0.0
return: mixed
param: string $name Method name.
param: mixed  $args Method-dependent arguments.

map_no_map( $results )   X-Ref
[map_no_map description]

since: 1.0.0
return: mixed
param: mixed $results The results, unmapped.

map( $results )   X-Ref
[map description]

since: 1.0.0
return: mixed
param: mixed $results The results, mapped.

query()   X-Ref
Performs a database query.

since: 1.0.0
return: mixed

create( $args )   X-Ref
Inserts a new row

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

create_and_select( $args )   X-Ref
Inserts a record and then selects it back based on the id

return: mixed the selected object or false on error
param: $args array see create()

update( $data, $where = null )   X-Ref
Updates a single row

param: $data array associative array with fields as keys and updated values as values

get( $thing_or_id )   X-Ref
No description

save( $args = null )   X-Ref
Saves an existing thing.

since: 1.0.0
return: bool|null Null and false on failure, true on success.
param: mixed $args Values to update.

delete()   X-Ref
Deletes a single row

since: 1.0.0

delete_all( $where = null )   X-Ref
Deletes all or multiple rows

since: 1.0.0
param: array $where An array of conditions to use to for a SQL "where" clause, if null, not used and all matching rows will be deleted.

delete_many( $where = null )   X-Ref
Deletes multiple rows

since: 2.0.0
param: array $where An array of conditions to use to for a SQL "where" clause, if not passed, no rows will be deleted.

set_fields( $db_object )   X-Ref
No description

normalize_fields( $args )   X-Ref
Normalizes an array with key-value pairs representing
a GP_Thing object.

since: 1.0.0
return: array Normalized arguments for a GP_Thing object.
param: array $args Arguments for a GP_Thing object.

prepare_fields_for_save( $args )   X-Ref
Prepares for enetering the database an array with
key-value pairs, preresenting a GP_Thing object.


now_in_mysql_format()   X-Ref
No description

prepare_fields_for_create( $args )   X-Ref
No description

get_db_field_formats( $args )   X-Ref
No description

coerce( $thing )   X-Ref
No description

after_create()   X-Ref
Is called after an object is created in the database.

This is a placeholder function which should be implemented in the child classes.

return: bool

after_save( $thing_before )   X-Ref
Is called after an object is saved to the database.

This is a placeholder function which should be implemented in the child classes.

return: bool
param: GP_Thing $thing_before Object before the update.

after_delete()   X-Ref
Is called after an object is deleted from the database.

This is a placeholder function which should be implemented in the child classes.

return: bool

sql_condition_from_php_value( $php_value )   X-Ref
No description

sql_from_conditions( $conditions )   X-Ref
No description

sql_from_order( $order_by, $order_how = '' )   X-Ref
No description

select_all_from_conditions_and_order( $conditions, $order = null )   X-Ref
No description

restrict_fields( $rules )   X-Ref
Sets restriction rules for fields.

since: 1.0.0
param: GP_Validation_Rules $rules The validation rules instance.

validate()   X-Ref
No description

force_false_to_null( $value )   X-Ref
No description

fields()   X-Ref
No description

sql_limit_for_paging( $page, $per_page = null )   X-Ref
No description

found_rows()   X-Ref
No description

like_escape_printf( $s )   X-Ref
No description

apply_default_conditions( $conditions_str )   X-Ref
No description

set_memory_limit( $new_limit )   X-Ref
No description



Generated: Tue Jan 22 01:02:31 2019 Cross-referenced by PHPXref 0.7.1