Method | Description | |
---|---|---|
__construct ( Inpsyde\MultilingualPress\Database\Table $table, Inpsyde\MultilingualPress\API\SiteRelations $site_relations ) | Constructor. Sets up the properties. | |
delete_relation ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type = 'post' ) : integer | Delete a relation according to the given parameters. | |
duplicate_relations ( integer $source_site_id, integer $destination_site_id, string $type = '' ) : integer | Copies all relations of the given (or any) content type from the given source site to the given destination site. | |
get_element_for_site ( integer $source_site_id, integer $target_site_id, integer $source_content_id, string $type ) : integer | Return the term taxonomy ID of the given target site for the given source term. | |
get_existing_translation_ids ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type ) : array | Return the existing translation IDs according to the given parameters. | |
get_relations ( integer $source_site_id, integer $source_content_id, string $type = 'post' ) : array | Return an array with site IDs as keys and content IDs as values. | |
get_translation_ids ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type ) : array | Return the existing (or new) translation IDs according to the given parameters. | |
has_site_relations ( integer $site_id, string $type = '' ) : boolean | Checks if the site with the given ID has any relations of the given (or any) content type. | |
relate_all_posts ( integer $source_site_id, integer $destination_site_id ) : integer | Relates all posts between the given source site and the given destination site. | |
relate_all_terms ( integer $source_site_id, integer $destination_site_id ) : integer | Relates all terms between the given source site and the given destination site. | |
set_relation ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type = 'post' ) : boolean | Set a relation according to the given parameters. |
Method | Description | |
---|---|---|
clean_up_duplicated_translation_ids ( array $relations, string $type ) : integer | Delete duplicate database entries. | |
get_cache_key ( integer $source_site_id, integer $source_content_id, string $type ) : string | Return the cache key for the given arguments. | |
get_new_translation_ids ( integer $source_site_id, integer $source_content_id, string $type ) : array | Return new translation IDs for the given parameters. | |
insert_row ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type ) : integer | Insert a row into the link table. |
public __construct ( Inpsyde\MultilingualPress\Database\Table $table, Inpsyde\MultilingualPress\API\SiteRelations $site_relations ) | ||
$table | Inpsyde\MultilingualPress\Database\Table | Content relations table object. |
$site_relations | Inpsyde\MultilingualPress\API\SiteRelations | Site relations API object. |
public delete_relation ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type = 'post' ) : integer | ||
$source_site_id | integer | Source blog ID. |
$target_site_id | integer | Target blog ID. |
$source_content_id | integer | Source post ID or term taxonomy ID. |
$target_content_id | integer | Target post ID or term taxonomy ID. |
$type | string | Content type. |
return | integer | Number of deleted rows |
public duplicate_relations ( integer $source_site_id, integer $destination_site_id, string $type = '' ) : integer | ||
$source_site_id | integer | Source site ID. |
$destination_site_id | integer | Destination site ID. |
$type | string | Optional. Content type. Defaults to empty string. |
return | integer | The number of relations duplicated. |
public get_element_for_site ( integer $source_site_id, integer $target_site_id, integer $source_content_id, string $type ) : integer | ||
$source_site_id | integer | Source blog ID. |
$target_site_id | integer | Target blog ID. |
$source_content_id | integer | Source post ID or term taxonomy ID. |
$type | string | Content type. |
return | integer |
public get_existing_translation_ids ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type ) : array | ||
$source_site_id | integer | Source blog ID. |
$target_site_id | integer | Target blog ID. |
$source_content_id | integer | Source post ID or term taxonomy ID. |
$target_content_id | integer | Target post ID or term taxonomy ID. |
$type | string | Content type. |
return | array |
public get_translation_ids ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type ) : array | ||
$source_site_id | integer | Source blog ID. |
$target_site_id | integer | Target blog ID. |
$source_content_id | integer | Source post ID or term taxonomy ID. |
$target_content_id | integer | Target post ID or term taxonomy ID. |
$type | string | Content type. |
return | array |
public set_relation ( integer $source_site_id, integer $target_site_id, integer $source_content_id, integer $target_content_id, string $type = 'post' ) : boolean | ||
$source_site_id | integer | Source blog ID. |
$target_site_id | integer | Target blog ID. |
$source_content_id | integer | Source post ID or term taxonomy ID. |
$target_content_id | integer | Target post ID or term taxonomy ID. |
$type | string | Content type. |
return | boolean |