Class WPDA_Media_Model

Model for plugin table 'table_settings'

author Peter Schulz
since 2.6.0
package WPDataAccess\Plugin_Table_Models
inherited_from \WPDataAccess\Plugin_Table_Models\WPDA_Plugin_Table_Base_Model

 Methods

Check if const BASE_TABLE_NAME is defined (cannot proceed without)

check_base_table_name() 
InheritedStatic

Return number of records in base table

count() : integer
InheritedStatic

Returns

integer

Delete a record fro the base table

delete(string $table_name, string $column_name, string $schema_name = '') : mixed
Static

Parameters

$table_name

string

Media table name

$column_name

string

Media column name

$schema_name

string

Schema name

Returns

mixedTransaction status

Get base table name

get_base_table_name() : string
InheritedStatic

Returns

stringBase table name

Returns the media type for a specific database schema/table/column

get_column_media($table_name, $column_name, $schema_name = '') : boolean | string
Static

Returns false if no media type is assigned to the database schema/table/column

Parameters

$table_name

$column_name

$schema_name

Returns

booleanstring

Returns pool (all media columns)

get_pool() : array | null
Static

Returns

arraynull

Insert a record in the base table

insert(string $table_name, string $column_name, string $media_type, string $media_activated = 'Yes', string $schema_name = '') : boolean
Static

Parameters

$table_name

string

Media table name

$column_name

string

Media column name

$media_type

string

Media type

$media_activated

string

Media activated?

$schema_name

string

Schema name

Returns

booleanTRUE = Insert was successful

Set up media column pool

setup_pool() 
Static

Gets all defined media columns and stores them in a two dimensional named array

Check if base table exists

table_exists() : boolean
InheritedStatic

Returns

booleanTRUE = table found

Update a record in the base table

update(string $table_name, string $column_name, string $media_type, string $schema_name = '') : mixed
Static

Parameters

$table_name

string

Media table name

$column_name

string

Media column name

$media_type

string

Media type

$schema_name

string

Schema name

Returns

mixedTransaction status

 Properties

 

Indicates if pool was already setup

$pool_setup : boolean

Default

false
Static
 

Holds all defined media columns

$pooled_media_columns : null | array

Default

null
Static

 Constants

 

Base table name (without prefixes): MUST BE DEFINED IN SUBCLASS!!!

BASE_TABLE_NAME = 'wpda_media' 
inherited_from \WPDataAccess\Plugin_Table_Models\WPDA_Plugin_Table_Base_Model::BASE_TABLE_NAME
 

Base table name (without prefixes): MUST BE DEFINED IN SUBCLASS!!!

BASE_TABLE_NAME = null