function _node_revision_delete_word_to_time in Node Revision Delete 7.3
Return a mapping of the old word values to numeric equivalents.
Parameters
string $word: The old word to map.
Return value
array|string The numeric value when a word is provided or the whole map.
3 calls to _node_revision_delete_word_to_time()
- drush_node_revision_delete_nrd_set_time in ./
node_revision_delete.drush.inc - Callback for the nrd-set-time command.
- node_revision_delete_drush_command in ./
node_revision_delete.drush.inc - Implements hook_drush_command().
- node_revision_delete_update_7301 in ./
node_revision_delete.install - Update node_revision_delete_time from words to seconds.
File
- ./
node_revision_delete.helpers.inc, line 202 - Helper functions.
Code
function _node_revision_delete_word_to_time($word = '') {
$word_map = array(
'never' => '-1',
'every_time' => '0',
'every_hour' => '3600',
'everyday' => '86400',
'every_week' => '604800',
'every_10_days' => '864000',
'every_15_days' => '1296000',
'every_month' => '2592000',
'every_3_months' => '7776000',
'every_6_months' => '15552000',
'every_year' => '31536000',
'every_2_years' => '63072000',
);
if (empty($word)) {
return $word_map;
}
else {
return $word_map[$word];
}
}