public function EventOperation::evaluate in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 src/Plugin/Condition/EventOperation.php \Drupal\rng\Plugin\Condition\EventOperation::evaluate()
- 3.x src/Plugin/Condition/EventOperation.php \Drupal\rng\Plugin\Condition\EventOperation::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/ EventOperation.php, line 68
Class
- EventOperation
- Provides an identity has operation permission on event condition.
Namespace
Drupal\rng\Plugin\ConditionCode
public function evaluate() {
$operation = 'manage event';
/* @var \Drupal\user\UserInterface $user */
$user = $this
->getContextValue('user');
/* @var \Drupal\Core\Entity\EntityInterface $event */
$event = $this
->getContextValue('event');
return $event
->access($operation);
}