You are here

protected function Recommender::processTable in Recommender API 6.2

1 call to Recommender::processTable()
Recommender::prepareData in ./Recommender.php
After calling this function, data would be ready to process. Could be: 1) if it's in database, then $->tableName, $this->$field* would store the correct info. 2) if it's in memory, then $this->directMatrix will be the matrix

File

./Recommender.php, line 117

Class

Recommender
The super class for all other Recommender algorithms.

Code

protected function processTable() {

  // if $tableName starts with SELECT, we consider it as a SQL query.
  if (stripos($this->tableName, 'SELECT ') === 0) {
    db_query("TRUNCATE {recommender_helper_staging}");
    db_query("INSERT INTO {recommender_helper_staging} SELECT {$this->fieldMouse}, {$this->fieldCheese}, {$this->fieldWeight} FROM ({$this->tableName}) sql_table");
    $this->tableName = "recommender_helper_staging";
    $this->fieldMouse = "mouse_id";
    $this->fieldCheese = "cheese_id";
    $this->fieldWeight = "weight";
  }
}