tid // WHERE term_tid = $term_branch->tid // Or do anything else that you own logic requires when merging of 2 terms // happens. }