You are here

protected function Recommender::batchInsert in Recommender API 6.2

2 calls to Recommender::batchInsert()
CorrelationRecommender::computePredictionMemory in ./Recommender.php
Recommender::saveSimilarityMatrix in ./Recommender.php

File

./Recommender.php, line 388

Class

Recommender
The super class for all other Recommender algorithms.

Code

protected function batchInsert($insert_sql, &$data) {

  // without using pass-by-reference, this might use more memory [#509424]

  //$chunks = array_chunk(&$data, INSERT_LIMIT, TRUE);
  $chunks = array_chunk($data, INSERT_LIMIT, TRUE);
  foreach ($chunks as $chunk) {
    update_sql($insert_sql . implode(',', $chunk));
  }
}