<?php

/**
 * User related functions
 * 
 */

require_once $MAIN_FILE;
require_once XOOPS_TRUST_PATH.'/modules/xdbmigrate/cmd/inc/migrate_db.inc.php';

class search_text{
  protected $db;

  public function init($db){
    $this->db = $db;
  }
  
  protected function migrate_search_text() {
    $tbl = get_tbl('xoonips_search_text');
    $wktbl = get_WK_tbl('xoonips_search_text');
    $sql = "insert into {$tbl} (file_id,search_text)".
    " select file_id,search_text from {$wktbl} ";
    $result_array = $this->db->query($sql);
    if($result_array === FALSE){
      return false;
    }
    return true;
  }


  public function migrate() {
    return $this->migrate_search_text();
  }
}
