/**
  * @param array $existing
  * @param int   $source_term_taxonomy_id
  * @param int   $target_site_id
  * @param int   $target_term_taxonomy_id
  *
  * @return bool
  */
 private function update_terms(array $existing, $source_term_taxonomy_id, $target_site_id, $target_term_taxonomy_id)
 {
     if (isset($existing[$target_site_id]) && $existing[$target_site_id] === $target_term_taxonomy_id) {
         return TRUE;
     }
     if (0 !== $target_term_taxonomy_id) {
         return $this->content_relations->set_relation($this->current_site_id, $target_site_id, $source_term_taxonomy_id, $target_term_taxonomy_id, 'term');
     }
     $translation_ids = $this->content_relations->get_translation_ids($this->current_site_id, $target_site_id, $source_term_taxonomy_id, $target_term_taxonomy_id, 'term');
     return $this->content_relations->delete_relation($translation_ids['ml_source_blogid'], $target_site_id, $translation_ids['ml_source_elementid'], 0, 'term');
 }
 /**
  * @param array $existing
  * @param int   $source_term_taxonomy_id
  * @param int   $target_site_id
  * @param int   $target_term_taxonomy_id
  *
  * @return bool
  */
 private function update_terms(array $existing, $source_term_taxonomy_id, $target_site_id, $target_term_taxonomy_id)
 {
     // There's nothing to do here
     if (-1 === $target_term_taxonomy_id) {
         return TRUE;
     }
     if (isset($existing[$target_site_id]) && $existing[$target_site_id] === $target_term_taxonomy_id) {
         return TRUE;
     }
     $translation_ids = $this->content_relations->get_translation_ids($this->current_site_id, $target_site_id, $source_term_taxonomy_id, $target_term_taxonomy_id, 'term');
     if ($translation_ids['ml_source_blogid'] !== $this->current_site_id) {
         $target_site_id = $this->current_site_id;
         if (0 !== $target_term_taxonomy_id) {
             $target_term_taxonomy_id = $source_term_taxonomy_id;
         }
     }
     // Delete a relation
     if (0 === $target_term_taxonomy_id) {
         return $this->content_relations->delete_relation($translation_ids['ml_source_blogid'], $target_site_id, $translation_ids['ml_source_elementid'], 0, 'term');
     }
     return $this->content_relations->set_relation($translation_ids['ml_source_blogid'], $target_site_id, $translation_ids['ml_source_elementid'], $target_term_taxonomy_id, 'term');
 }