/** * @param EventNotificationTemplate $notificationTemplate * @param kEventScope $scope * @return boolean */ protected function notificationTemplatesConditionsFulfilled(EventNotificationTemplate $notificationTemplate, kEventScope $scope) { $eventConditions = $notificationTemplate->getEventConditions(); if (!$eventConditions || !count($eventConditions)) { return true; } foreach ($eventConditions as $eventCondition) { /* @var $eventCondition kCondition */ if (!$eventCondition->fulfilled($scope)) { return false; } } return true; }
/** * @param EventNotificationTemplate $notificationTemplate * @param kEventScope $scope * @return boolean */ protected function notificationTemplatesConditionsFulfilled(EventNotificationTemplate $notificationTemplate, kEventScope $scope) { KalturaLog::info("Checking conditions for notification templat ID [" . $notificationTemplate->getId() . "] and scope: " . print_r($scope, true)); $eventConditions = $notificationTemplate->getEventConditions(); if (!$eventConditions || !count($eventConditions)) { return true; } foreach ($eventConditions as $eventCondition) { /* @var $eventCondition kEventCondition */ if (!$eventCondition->fulfilled($scope)) { KalturaLog::debug("Template [" . $notificationTemplate->getId() . "] condition not fulfilled"); return false; } } return true; }