public function CurrentTime::evaluate in RNG - Events and Registrations 8.2
Same name and namespace in other branches
- 8 src/Plugin/Condition/CurrentTime.php \Drupal\rng\Plugin\Condition\CurrentTime::evaluate()
- 3.x src/Plugin/Condition/CurrentTime.php \Drupal\rng\Plugin\Condition\CurrentTime::evaluate()
Evaluates the condition and returns TRUE or FALSE accordingly.
Return value
bool TRUE if the condition has been met, FALSE otherwise.
Overrides ConditionInterface::evaluate
File
- src/
Plugin/ Condition/ CurrentTime.php, line 125
Class
- CurrentTime
- Evaluates if the current date is before or after the the configured date.
Namespace
Drupal\rng\Plugin\ConditionCode
public function evaluate() {
$date = $this
->getDate();
if ($date && is_numeric($date)) {
if (!$this
->isNegated()) {
return time() > $date;
}
else {
return time() < $date;
}
}
return FALSE;
}