You are here

function drush_votingapi_generate_votes in Voting API 7.2

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

Command callback. Generate a number of votes.

File

./votingapi.drush.inc, line 65
Drush commands to 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'),
  );
  require_once drupal_get_path('module', 'votingapi') . '/votingapi.devel.inc';
  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');
}