public function duplicate_relations($source_site_id, $destination_site_id, $type = '')
{
$args = [$destination_site_id, $source_site_id];
$query = "\nINSERT INTO {$this->table} (\n\tml_source_blogid,\n\tml_source_elementid,\n\tml_blogid,\n\tml_elementid,\n\tml_type\n)\nSELECT ml_source_blogid, ml_source_elementid, %d, ml_elementid, ml_type\nFROM {$this->table}\nWHERE ml_blogid = %d";
if ($type) {
$query .= ' AND ml_type = %s';
$args[] = $type;
}
return (int) $this->db->query($this->db->prepare($query, $args));
}