PHP Interface Inpsyde\MultilingualPress\API\SiteRelations

Since: 3.0.0
Show file Open project: inpsyde/multilingual-press Interface Usage Examples

Public Methods

Method Description
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.

Method Details

delete_relation() public method

Deletes the relationship between the given sites. If only one site is given, all its relations will be deleted.
Since: 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.
return integer The number of rows affected.

get_all_relations() public method

Returns an array with site IDs as keys and arrays with the IDs of all related sites as values.
Since: 3.0.0
public get_all_relations ( ) : int[]
return int[] The array with site IDs as keys and arrays with the IDs of all related sites as values.

insert_relations() public method

Creates relations between one site and one or more other sites.
Since: 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.
return integer The number of rows affected.