Class WPDA_Export_Json

This class should not be instantiated directly. Use it to built exports for specific types. Overwrite methods header, row and footer for your own type specific export.

author Peter Schulz
since 2.0.13
package WPDataAccess\Utilities
inherited_from \WPDataAccess\Utilities\WPDA_Export_Formatted

 Methods

WPDA_Export_Formatted constructor.

__construct() 
Inherited
since 2.0.13

Main method to get arguments and start export.

export() 
Inherited
since 2.0.13

Perform query and get rows

get_rows() 
Inherited

Result is stored in $this->rows.

since 2.0.13

File header for JSON export

header() 
since 2.0.13
inherited_from \WPDataAccess\Utilities\WPDA_Export_Formatted::header()

Implement file header here

header() 
Inherited

Check if data type is numeric

is_numeric(string $data_type) : boolean
Inherited

Parameters

$data_type

string

Column data type

Returns

booleanTRUE = numeric

Process one row to be export in JSON format

row(array $row) 
since 2.0.13
inherited_from \WPDataAccess\Utilities\WPDA_Export_Formatted::row()

Parameters

$row

array

Implement how to process a row here

row($row) 
Inherited

Parameters

$row

Send export file to browser

send_export_file() 
Inherited
since 2.0.13

 Properties

 

Select columns

$columns : array | null

Default

null
 

Column data types

$data_types : array

Default

array()
 

Variable used for loop processing

$first_row : boolean

Default

true
 

Number of rows found

$row_count : integer

Default

0
 

Array containing selected rows

$rows : null

Default

null
 

Database schema name

$schema_name : string

Default

''
 

Query

$statement : string

Default

''

Select statement used to perform export.

 

Database table name

$table_names : string

Default

''
 

Primary key columns

$table_primary_key : array

Default

array()
 

Where clause added to query

$where : string

Default

''
 

Handle to table columns

$wpda_list_columns : object | null

Default

null