Свойство | Type | Description | |
---|---|---|---|
$aliases | array | ||
$api | PodsAPI | ||
$data | |||
$detail_page | |||
$display_errors | boolean | ||
$field_id | string | ||
$field_index | string | ||
$field_slug | string | ||
$fields | array | ||
$filters | array | ||
$id | integer | ||
$insert_id | |||
$instance | PodsData | ||
$join | string | ||
$limit | integer | ||
$orderby | string | ||
$page | integer | ||
$page_var | string | ||
$pagination | boolean | ||
$pod | null | ||
$pod_data | array | boolean | mixed | null | void | ||
$row | |||
$row_number | integer | ||
$search | boolean | ||
$search_fields | array | ||
$search_mode | string | ||
$search_query | string | ||
$search_var | string | ||
$search_where | string | ||
$select | null | ||
$sql | string | Last select() query SQL | |
$table | null | ||
$total | |||
$total_found | |||
$total_found_calculated | boolean | ||
$total_sql | string | Last total sql | |
$traversal | array | Holds Traversal information about Pods | |
$traverse | array | Holds custom Traversals to be included | |
$where | array | ||
$where_default | array |
Свойство | Type | Description | |
---|---|---|---|
$field_types | array | ||
$prefix | string |
Méthode | Description | |
---|---|---|
__construct ( string $pod = null, integer $id, boolean $strict = true ) : PodsData | Data Abstraction Class for Pods | |
build ( array $params ) : boolean | mixed | string | Build/Rewrite dynamic SQL and handle search/filter/sort | |
calculate_totals ( ) | ||
delete ( string $table, array $where, array $where_format = null ) : array | boolean | mixed | null | void | Delete an item | |
fetch ( integer $row = null, boolean $explicit_set = true ) : mixed | Fetch a new row for the current pod_data | |
get_column_data ( string $column_name, string $table ) : array | Gets column data information from a table | |
get_sql ( $sql ) | Get the complete sql | |
get_table_columns ( string $table ) : array | Gets column information from a table | |
get_tables ( boolean $wp_core = true, boolean $pods_tables = true ) : array | Gets all tables in the WP database, optionally exclude WP core tables, and/or Pods table by settings the parameters to false. | |
init ( string $pod = null, integer $id, boolean $strict = true ) : PodsData | Singleton handling for a basic pods_data() request | |
insert ( string $table, array $data, array $format = null ) : integer | boolean | Insert an item, eventually mapping to WPDB::insert | |
insert_on_duplicate ( string $table, array $data, array $formats = [] ) : mixed | ||
nth ( integer | string $nth ) : boolean | Fetch the nth state | |
position ( ) : integer | Fetch the current position in the loop (starting at 1) | |
prepare ( string $sql, array $data ) : boolean | null | string | Prepare values for the DB | |
query ( string | array $sql, string $error = 'Database Error', null $results_error = null, null $no_results_error = null ) : array | boolean | mixed | null | void | ||
query_field ( string | integer $field, array | string $q, array $pod = null, object &$params = null ) : string | null | Get the string to use in a query for matching, uses WP_Query meta_query arguments | |
query_fields ( array $fields, array $pod = null, object &$params = null ) : string | null | Get the string to use in a query for WHERE/HAVING, uses WP_Query meta_query arguments | |
reorder ( string $table, string $weight_field, string $id_field, array $ids ) : boolean | Reorder Items | |
reset ( integer $row = null ) : mixed | Reset the current data | |
select ( array $params ) : array | boolean | mixed | Select items, eventually building dynamic query | |
table ( array | string $table, string $object = '' ) | Handle tables like they are Pods (for traversal in select/build) | |
table_alter ( string $table, string $changes ) : array | boolean | mixed | null | void | Alter a Table | |
table_create ( string $table, string $fields, boolean $if_not_exists = false ) : array | boolean | mixed | null | void | Create a Table | |
table_drop ( string $table ) : array | boolean | mixed | null | void | Drop a Table | |
table_truncate ( string $table ) : array | boolean | mixed | null | void | Truncate a Table | |
total ( ) : integer | Fetch the total row count returned | |
total_found ( ) : integer | Fetch the total row count total | |
traverse ( array $fields = null, null $all_fields = null, object $params = null ) : array | Recursively join tables based on fields | |
traverse_build ( array $fields = null, object $params = null ) : array | Setup fields for traversal | |
traverse_recurse ( array $traverse_recurse ) : array | Recursively join tables based on fields | |
update ( string $table, array $data, array $where, array $format = null, array $where_format = null ) : boolean | Update an item, eventually mapping to WPDB::update | |
zebra ( ) : boolean | Fetch the zebra state |
Méthode | Description | |
---|---|---|
do_hook ( ) | Handle filters / actions for the class |
public delete ( string $table, array $where, array $where_format = null ) : array | boolean | mixed | null | void | ||
$table | string | Table name |
$where | array | A named array of WHERE clauses (in column => value pairs). Multiple clauses will be joined with ANDs. Both $where columns and $where values should be "raw". |
$where_format | array | (optional) An array of formats to be mapped to each of the values in $where. |
Résultat | array | boolean | mixed | null | void |
public static get_table_columns ( string $table ) : array | ||
$table | string | Table Name |
Résultat | array |
public insert ( string $table, array $data, array $format = null ) : integer | boolean | ||
$table | string | Table name |
$data | array | Data to insert (in column => value pairs). Both $data columns and $data values should be "raw" (neither should be SQL escaped). |
$format | array | (optional) An array of formats to be mapped to each of the value in $data. |
Résultat | integer | boolean | The ID of the item |
public static query ( string | array $sql, string $error = 'Database Error', null $results_error = null, null $no_results_error = null ) : array | boolean | mixed | null | void | ||
$sql | string | array | The SQL to execute |
$error | string | Error to throw on problems |
$results_error | null | (optional) |
$no_results_error | null | (optional) |
Résultat | array | boolean | mixed | null | void | Result of the query |
public static query_field ( string | integer $field, array | string $q, array $pod = null, object &$params = null ) : string | null | ||
$field | string | integer | Field name or array index |
$q | array | string | Query array (meta_query) or string for matching |
$pod | array | Related Pod |
$params | object | Parameters passed from select() |
Résultat | string | null | Query field string |
public total_found ( ) : integer | ||
Résultat | integer | Number of rows found by select() |
public traverse ( array $fields = null, null $all_fields = null, object $params = null ) : array | ||
$fields | array | Fields to recurse |
$all_fields | null | (optional) If $fields is empty then traverse all fields, argument does not need to be passed |
$params | object | (optional) Parameters from build() |
Résultat | array | Array of joins |
public traverse_recurse ( array $traverse_recurse ) : array | ||
$traverse_recurse | array | Array of traversal options |
Résultat | array | Array of table joins |
public update ( string $table, array $data, array $where, array $format = null, array $where_format = null ) : boolean | ||
$table | string | Table name |
$data | array | Data to update (in column => value pairs). Both $data columns and $data values should be "raw" (neither should be SQL escaped). |
$where | array | A named array of WHERE clauses (in column => value pairs). Multiple clauses will be joined with ANDs. Both $where columns and $where values should be "raw". |
$format | array | (optional) An array of formats to be mapped to each of the values in $data. |
$where_format | array | (optional) An array of formats to be mapped to each of the values in $where. |
Résultat | boolean |
public array $traversal | ||
Résultat | array |
public array $traverse | ||
Résultat | array |