PHP Класс RTDBModel, rtMedia

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$mu_single_table
$per_page
$table_name type - database table linked to the model. All the queries will be fired on that table or with the join in this table. $per_page - number of rows per page to be displayed

Открытые методы

Метод Описание
__call ( string $name, array $arguments ) : array Magic Method for getting DB rows by particular column.
__construct ( string $table_name, boolean $withprefix = false, $per_page = 10, $mu_single_table = false )
delete ( array $where ) : array
get ( array $columns, $offset = false, $per_page = false, $order_by = 'id desc' ) : array Get all the rows according to the columns set in $columns parameter.
insert ( array $row ) : integer
set_per_page ( integer $per_page ) set number of rows per page for pagination
set_table_name ( string $table_name, mixed $withprefix = false )
update ( array $data, array $where )

Описание методов

__call() публичный Метод

E.g., get_by_(params)
public __call ( string $name, array $arguments ) : array
$name string - Added get_by_(value,pagging=true,page_no=1)
$arguments array
Результат array result array

__construct() публичный Метод

public __construct ( string $table_name, boolean $withprefix = false, $per_page = 10, $mu_single_table = false )
$table_name string Table name for model
$withprefix boolean Set true if $tablename is with prefix otherwise it will prepend wordpress prefix with "rt_"

delete() публичный Метод

public delete ( array $where ) : array
$where array
Результат array

get() публичный Метод

offset and rows per page can also be passed for pagination.
public get ( array $columns, $offset = false, $per_page = false, $order_by = 'id desc' ) : array
$columns array
Результат array

insert() публичный Метод

public insert ( array $row ) : integer
$row array
Результат integer

set_per_page() публичный Метод

set number of rows per page for pagination
public set_per_page ( integer $per_page )
$per_page integer

set_table_name() публичный Метод

public set_table_name ( string $table_name, mixed $withprefix = false )
$table_name string
$withprefix mixed

update() публичный Метод

public update ( array $data, array $where )
$data array
$where array

Описание свойств

$mu_single_table публичное свойство

public $mu_single_table

$per_page публичное свойство

public $per_page

$table_name публичное свойство

- database table linked to the model. All the queries will be fired on that table or with the join in this table. $per_page - number of rows per page to be displayed
public type $table_name
Результат type