You are here

function drush_votingapi_generate_votes in Voting API 7.3

Same name and namespace in other branches
  1. 8.3 votingapi.drush.inc \drush_votingapi_generate_votes()
  2. 7.2 votingapi.drush.inc \drush_votingapi_generate_votes()

Command callback. Generate a number of votes.

File

./votingapi.drush.inc, line 64
Generate votingapi votes, recalculate results for existing votes, or flush VotingAPI data entirely.

Code

function drush_votingapi_generate_votes($entity_type = 'node', $vote_type = 'percent') {
  $options = array(
    'kill' => drush_get_option('kill'),
    'age' => drush_get_option('age'),
    'types' => drush_get_option('types'),
  );
  votingapi_generate_votes($entity_type, $vote_type, $options);
  drush_log(t('Generating @vtype votes for @etype entities.', array(
    '@vtype' => $vote_type,
    '@etype' => $entity_type,
  )), 'success');
}