You are here

protected function Recommender::getEntityNum in Recommender API 6.2

2 calls to Recommender::getEntityNum()
Recommender::getCheeseNum in ./Recommender.php
Recommender::getMouseNum in ./Recommender.php

File

./Recommender.php, line 245

Class

Recommender
The super class for all other Recommender algorithms.

Code

protected function getEntityNum($field) {
  $sql = "SELECT COUNT(DISTINCT {$field}) FROM ";
  if (stripos($this->tableName, 'SELECT ') === 0) {
    $sql .= "({$this->tableName}) sql_table";
  }
  else {
    $sql .= "{{$this->tableName}}";
  }
  return db_result(db_query($sql));
}