You are here

function rec_example_reload_ratings in Recommender API 7.5

File

rec_example/rec_example.module, line 239

Code

function rec_example_reload_ratings() {
  recommender_purge('rec_example', 'rec_example_update');

  //(1,1,1),(1,2,5),(1,4,2),(1,5,4),(2,1,4),(2,2,2),(2,4,5),(2,5,1),(2,6,2),(3,1,2),(3,2,4),(3,3,3),(3,6,5),(4,1,2),(4,2,4),(4,4,5),(4,5,1)
  $values = array(
    array(
      1,
      1,
      1,
    ),
    array(
      1,
      2,
      5,
    ),
    array(
      1,
      4,
      2,
    ),
    array(
      1,
      5,
      4,
    ),
    array(
      2,
      1,
      4,
    ),
    array(
      2,
      2,
      2,
    ),
    array(
      2,
      4,
      5,
    ),
    array(
      2,
      5,
      1,
    ),
    array(
      2,
      6,
      2,
    ),
    array(
      3,
      1,
      2,
    ),
    array(
      3,
      2,
      4,
    ),
    array(
      3,
      3,
      3,
    ),
    array(
      3,
      6,
      5,
    ),
    array(
      4,
      1,
      2,
    ),
    array(
      4,
      2,
      4,
    ),
    array(
      4,
      4,
      5,
    ),
    array(
      4,
      5,
      1,
    ),
  );
  recommender_insert_rows('preference', 'rec_example', $values);
}