PHP Класс Inpsyde\MultilingualPress\API\WPDBSiteRelations

С версии: 3.0.0
Наследование: implements Inpsyde\MultilingualPress\API\SiteRelations
Показать файл Открыть проект

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

Метод Описание
__construct ( Inpsyde\MultilingualPress\Database\Table $table ) Constructor. Sets up the properties.
delete_relation ( integer $site_1, integer $site_2 ) : integer Deletes the relationship between the given sites. If only one site is given, all its relations will be deleted.
get_all_relations ( ) : int[] Returns an array with site IDs as keys and arrays with the IDs of all related sites as values.
get_related_site_ids ( integer $site_id, boolean $include_site = false ) : int[] Returns an array holding the IDs of all sites related to the site with the given (or current) ID.
insert_relations ( integer $base_site_id, array $site_ids ) : integer Creates relations between one site and one or more other sites.

Приватные методы

Метод Описание
get_site_relations_from_query_results ( array $rows ) : int[] Returns a formatted array with site relations included in the given query results.
get_value_pair ( integer $site_1, integer $site_2 ) : string Returns a (value1, value2) syntax string according to the given site IDs.

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

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

Constructor. Sets up the properties.
С версии: 3.0.0
public __construct ( Inpsyde\MultilingualPress\Database\Table $table )
$table Inpsyde\MultilingualPress\Database\Table Site relations table object.

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

Deletes the relationship between the given sites. If only one site is given, all its relations will be deleted.
С версии: 3.0.0
public delete_relation ( integer $site_1, integer $site_2 ) : integer
$site_1 integer Site ID.
$site_2 integer Optional. Another site ID. Defaults to 0.
Результат integer The number of rows affected.

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

Returns an array with site IDs as keys and arrays with the IDs of all related sites as values.
С версии: 3.0.0
public get_all_relations ( ) : int[]
Результат int[] The array with site IDs as keys and arrays with the IDs of all related sites as values.

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

Creates relations between one site and one or more other sites.
С версии: 3.0.0
public insert_relations ( integer $base_site_id, array $site_ids ) : integer
$base_site_id integer Base site ID.
$site_ids array An array of site IDs.
Результат integer The number of rows affected.