예제 #1
0
 public function getRandomIds($recordCount, $searchParameters = array())
 {
     $where = $this->prepareWhere($searchParameters, $this->getMetadata(), __METHOD__);
     $sqlParams = array('tableName' => $this->tableName, 'recordCount' => $recordCount, 'whereClause' => count($where) > 0 ? 'WHERE ' . join(' AND ', $where) : '');
     $query = TextProcessor::doText(file_get_contents(__DIR__ . "/Templates/GetRandomIds.sql"), $sqlParams);
     return Database::getInstance()->getColumn($query, 'id');
 }