Core class used to implement the notes system.
since | 3.0.0 |
---|---|
package | GlotPress |
inherited_from | \GP_Thing |
__construct($fields = array()
)
after_create() : boolean
This is a placeholder function which should be implemented in the child classes.
boolean
after_delete() : boolean
This is a placeholder function which should be implemented in the child classes.
boolean
after_save(\GP_Thing $thing_before) : boolean
This is a placeholder function which should be implemented in the child classes.
\GP_Thing
Object before the update.
boolean
all($order = null
)
apply_default_conditions($conditions_str)
coerce($thing)
create($args) : mixed
array associative array with fields as keys and values as values
mixed
the object corresponding to the inserted row or false on errorcreate_and_select($args) : mixed
array see create()
mixed
the selected object or false on errordelete()
since | 1.0.0 |
---|
delete_all(array $where = null
)
since | 1.0.0 |
---|
array
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(array $where = null
)
since | 2.0.0 |
---|
array
An array of conditions to use to for a SQL "where" clause, if not passed, no rows will be deleted.
edit(string $note_id, string $note, string $translation) : object
since | 3.0.0 |
---|
string
Note ID.
string
Note object.
string
Translation object.
object
The output of the query.fields()
find(string|array $conditions, string|array $order = null
) : mixed
since | 1.0.0 |
---|
string
array
string
array
Optional.
mixed
find_many(string|array $conditions, string|array $order = null
) : mixed
since | 1.0.0 |
---|
string
array
string
array
Optional.
mixed
find_many_no_map(string|array $conditions, string|array $order = null
) : mixed
since | 1.0.0 |
---|
string
array
string
array
Optional.
mixed
find_no_map(string|array $conditions, string|array $order = null
) : mixed
since | 1.0.0 |
---|
string
array
string
array
Optional.
mixed
find_one(string|array $conditions, string|array $order = null
) : mixed
since | 1.0.0 |
---|
string
array
string
array
Optional.
mixed
force_false_to_null($value)
found_rows()
get($thing_or_id)
get_by_translation_id(object $translation_id, object $order = null
) : array
since | 3.0.0 |
---|
object
The translation id.
object
The note order.
array
notesget_db_field_formats($args)
get_static($name, $default = null
)
has_static($name)
like_escape_printf($s)
many() : mixed
For parameters description see $wpdb->prepare()
.
since | 1.0.0 |
---|
mixed
An object, containing the selected row or false on error.many_no_map() : mixed
since | 1.0.0 |
---|
mixed
map(mixed $results) : mixed
since | 1.0.0 |
---|
mixed
The results, mapped.
mixed
map_no_map(mixed $results) : mixed
since | 1.0.0 |
---|
mixed
The results, unmapped.
mixed
normalize_fields(array $args) : array
todo | Include default type handling. For example dates 0000-00-00 should be set to null |
---|---|
since | 1.0.0 |
since | 3.0.0 Normalizes int fields to be integers. |
array
Arguments for a GP_Thing object.
array
Normalized arguments for a GP_Thing object.now_in_mysql_format()
one() : mixed
For parameters description see BPDB::prepare()
mixed
an object, containing the selected row or false on errorprepare($args)
prepare_fields_for_create($args)
prepare_fields_for_save($args)
query() : mixed
since | 1.0.0 |
---|
mixed
reload()
restrict_fields(\GP_Validation_Rules $rules)
since | 1.0.0 |
---|
\GP_Validation_Rules
The validation rules instance.
save(string $args = null
) : object
since | 3.0.0 |
---|---|
inherited_from | \GP_Thing::save() |
string
Parameters that are not used.
object
The output of the query.save(mixed $args = null
) : boolean | null
since | 1.0.0 |
---|
mixed
Values to update.
boolean
null
Null and false on failure, true on success.select_all_from_conditions_and_order($conditions, $order = null
)
set_fields(array $fields)
array
Fields for a GP_Thing object.
set_memory_limit($new_limit)
set_static($name, $value)
sql_condition_from_php_value($php_value)
sql_from_conditions($conditions)
sql_from_order($order_by, $order_how = ''
)
sql_limit_for_paging($page, $per_page = null
)
update($data, $where = null
)
array associative array with fields as keys and updated values as values
validate()
value() : scalar
For parameters description see BPDB::prepare()
scalar
the result of the query or false on error_no_map(string $name, mixed $args) : mixed
since | 1.0.0 |
---|
string
Method name.
mixed
Method-dependent arguments.
mixed
$class
$default_conditions
$default_order : array
'ORDER BY date_added DESC'
$errors
array()
$field_names : array
array('id', 'original_id', 'translation_id', 'note', 'user_id', 'date_added', 'date_modified')
inherited_from | \GP_Thing::field_names |
---|
$field_names
array()
$id
$int_fields : array
array('id', 'original_id', 'translation_id', 'user_id')
inherited_from | \GP_Thing::int_fields |
---|
$int_fields
array()
$map_results
true
$non_db_field_names
array()
$non_updatable_attributes : array
array('id')
inherited_from | \GP_Thing::non_updatable_attributes |
---|
$non_updatable_attributes
$per_page
30
$static
array()
$static_by_class
array()
$table
null
$table_basename : string
'gp_notes'
inherited_from | \GP_Thing::table_basename |
---|
$table_basename
$validation_rules
null
$validation_rules_by_class
array()