/**
  * Replace all likes on one item with another
  * Used when merging two items
  *
  * @param	int		$id1			The ID of the item being deleted
  * @param	int		$id2			The ID of the item being kept
  */
 public function merge($id1, $id2)
 {
     /* We need to tell the driver not to escape our md5 compilation statements */
     $_fieldEncapsulate = $this->DB->fieldEncapsulate;
     $this->DB->fieldEncapsulate = '';
     $this->DB->manual_addslashes = TRUE;
     /* Run the query - this looks a bit nuts, but basically we're setting any records for
     		likes on the old item to now be likes on the new, unelss the user has already liked
     		the new, in which case do nothing and we'll delete the left-overs in a minute */
     $this->DB->update(array('core_like' => 'a'), $this->DB->compileUpdateString(array('a.like_id' => classes_like_registry::getKeyForSql($id2, 'a.like_member_id'), 'a.like_lookup_id' => classes_like_registry::getKeyForSql($id2), 'a.like_lookup_area' => classes_like_registry::getKeyForSql(null, 'a.like_member_id'), 'a.like_rel_id' => intval($id2))), "a.like_app='{$this->_app}' AND a.like_area='{$this->_area}' AND a.like_rel_id={$id1} AND b.like_id " . $this->DB->buildIsNull(), false, true, array(array('from' => array('core_like' => 'b'), 'where' => "b.like_app='{$this->_app}' AND b.like_area='{$this->_area}' AND b.like_rel_id={$id2}")));
     /* Reset the DB driver */
     $this->DB->manual_addslashes = FALSE;
     $this->DB->fieldEncapsulate = $_fieldEncapsulate;
     /* Remove any stragglers (would happen if user was subscribed to both topics */
     $this->remove($id1);
     /* Reset the cache */
     classes_like_cache::getInstance()->isNowStale($id1);
     classes_like_cache::getInstance()->isNowStale($id2);
 }