/** * Dispatch event notification object by id * * @param int $id * @param KalturaEventNotificationScope $scope * @return int */ function dispatch($id, KalturaEventNotificationScope $scope) { $kparams = array(); $this->client->addParam($kparams, "id", $id); $this->client->addParam($kparams, "scope", $scope->toParams()); $this->client->queueServiceActionCall("eventnotification_eventnotificationtemplate", "dispatch", $kparams); if ($this->client->isMultiRequest()) { return $this->client->getMultiRequestResult(); } $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "integer"); return $resultObject; }
/** * Dispatch event notification object by id * * @action dispatch * @param int $id * @param KalturaEventNotificationScope $scope * @throws KalturaEventNotificationErrors::EVENT_NOTIFICATION_TEMPLATE_NOT_FOUND * @throws KalturaEventNotificationErrors::EVENT_NOTIFICATION_DISPATCH_DISABLED * @throws KalturaEventNotificationErrors::EVENT_NOTIFICATION_DISPATCH_FAILED * @return int */ public function dispatchAction($id, KalturaEventNotificationScope $scope) { // get the object $dbEventNotificationTemplate = EventNotificationTemplatePeer::retrieveByPK($id); if (!$dbEventNotificationTemplate) { throw new KalturaAPIException(KalturaEventNotificationErrors::EVENT_NOTIFICATION_TEMPLATE_NOT_FOUND, $id); } if (!$dbEventNotificationTemplate->getManualDispatchEnabled()) { throw new KalturaAPIException(KalturaEventNotificationErrors::EVENT_NOTIFICATION_DISPATCH_DISABLED, $id); } $jobId = $dbEventNotificationTemplate->dispatch($scope->toObject()); if (!$jobId) { throw new KalturaAPIException(KalturaEventNotificationErrors::EVENT_NOTIFICATION_DISPATCH_FAILED, $id); } return $jobId; }