function UpdateHelper::lastRun in Evercurrent 8
Same name and namespace in other branches
- 8.2 src/UpdateHelper.php \Drupal\evercurrent\UpdateHelper::lastRun()
Get interval since last try.
Return value
string
File
- src/
UpdateHelper.php, line 269 - Contains Drupal\evercurrent\UpdateHelper.
Class
- UpdateHelper
- Class UpdateHelper.
Namespace
Drupal\evercurrentCode
function lastRun() {
$last = \Drupal::state()
->get('evercurrent_last_run') ?: 0;
if ($last > 0) {
$last_time = \Drupal::service('date.formatter')
->formatInterval(time() - $last);
}
else {
$last_time = t('Never.');
}
return t('%last_time', [
'%last_time' => $last_time,
]);
}