Constructor & Destructor Documentation
Constructs the object
- Parameters:
-
string | $page_id | The page identifier |
string | $db_file | The source file of the database json file |
array | $config | The configuration array public |
- Returns:
- void
Member Function Documentation
Does an delete public
- Returns:
- array
Dumps the json not in the right format exception
- Parameters:
-
protected
- Returns:
- void
Gets the user input part from a json used to build the SQL The json array should be the same json array used in the json2sql function. The "user_input" section should be another json array in the form: {'fields: { 'variable1': [ {'as_part' => 'field_name'}, ... // If the variable is present in GET or POST, this part will be added to final sql ], 'variable2': ... }, 'tables': { 'variable1': 'string representing the from part of the select', 'variable2': ... }, 'where': { 'variable1': 'string representing the where part of the select', 'variable2': ... //Please notice the the function will not add the "and" or "or" parts. These should be present in the strings }, 'having': { 'variable1': 'string representing the having part of the select', 'variable2': ...//Please notice the the function will not add the "and" or "or" parts. These should be present in the strings }, 'order': { 'variable1': [ 'field', ..., ], 'variable2': ... } Any part is OPTIONAL, as the entire user_input section NOTE: If you want the use inputs to be escaped, then name the key with '__' as prefix.
- Parameters:
-
array | $json | The json array |
string | $search | The part being searched (fields | tables | where | having | grouping | order | limit) |
public
- Returns:
- array
Does an insert public
- Returns:
- array
Constructs an SQL query from a json object The json array should have the format: { 'type': 'string (select | insert | update | delete | replace)', 'fields': [ {'as_part' => 'field_name'}, ... // For the selects OR {'field_name' => 'value'}, ... // For the updates ], 'tables': 'string representing the from part of the select', 'where': 'string representing the where part of the select [OPTIONAL]', 'having': 'string representing the having part of the select [OPTIONAL]', 'grouping': [ 'field', ..., '[OPTIONAL]' ], 'order': [ {'field_name' => 'asc|desc'}, ... //[OPTIONAL] ], 'limit' : [from, count] //[OPTIONAL], 'user_input': see the user input function [OPTIONAL] }
- Parameters:
-
array | $json | The json array public |
- Returns:
- string
Constructs a SQL delete from a json object For the description of the json format, see the json2sql function
- Parameters:
-
protected
- Returns:
- string
Constructs a SQL insert from a json object For the description of the json format, see the json2sql function
- Parameters:
-
protected
- Returns:
- string
Constructs a SQL select from a json object For the description of the json format, see the json2sql function
- Parameters:
-
protected
- Returns:
- string
Constructs a SQL update from a json object For the description of the json format, see the json2sql function
- Parameters:
-
protected
- Returns:
- string
Process the fields part of an SQL insert string
- Parameters:
-
array | $fields | The fields part of json |
protected
- Returns:
- string
Process the fields part of an SQL update string
- Parameters:
-
array | $fields | The fields part of json |
protected
- Returns:
- string
Returns the rows for a select public
- Returns:
- array
Does an update public
- Returns:
- array
Field Documentation
The documentation for this class was generated from the following file: