protected function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     /* @var $dbObject kBusinessProcessNotificationDispatchJobData */
     parent::doFromObject($dbObject, $responseProfile);
     $server = $dbObject->getServer();
     $this->server = KalturaBusinessProcessServer::getInstanceByType($server->getType());
     $this->server->fromObject($server);
 }
 public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     /* @var $dbObject kEmailNotificationDispatchJobData */
     parent::doFromObject($dbObject, $responseProfile);
     $this->to = KalturaEmailNotificationRecipientJobData::getDataInstance($dbObject->getTo());
     $this->cc = KalturaEmailNotificationRecipientJobData::getDataInstance($dbObject->getCc());
     $this->bcc = KalturaEmailNotificationRecipientJobData::getDataInstance($dbObject->getBcc());
     $this->replyTo = KalturaEmailNotificationRecipientJobData::getDataInstance($dbObject->getReplyTo());
     $this->customHeaders = KalturaKeyValueArray::fromKeyValueArray($dbObject->getCustomHeaders());
 }
 /**
  * Dispatch event notification object by id
  * 
  * @action dispatch
  * @param int $id 
  * @param KalturaEventNotificationDispatchJobData $jobData 
  * @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, KalturaEventNotificationDispatchJobData $data)
 {
     // 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);
     }
     $jobData = $data->toObject($dbEventNotificationTemplate->getJobData());
     $job = kEventNotificationFlowManager::addEventNotificationDispatchJob($dbEventNotificationTemplate->getType(), $jobData);
     if (!$job) {
         throw new KalturaAPIException(KalturaEventNotificationErrors::EVENT_NOTIFICATION_DISPATCH_FAILED, $id);
     }
     return $job->getId();
 }
 public function fromObject($dbObject)
 {
     /* @var $dbObject kEmailNotificationDispatchJobData */
     parent::fromObject($dbObject);
     $this->to = KalturaEmailNotificationRecipientJobData::getDataInstance($dbObject->getTo());
     $this->cc = KalturaEmailNotificationRecipientJobData::getDataInstance($dbObject->getCc());
     $this->bcc = KalturaEmailNotificationRecipientJobData::getDataInstance($dbObject->getBcc());
     $this->replyTo = KalturaEmailNotificationRecipientJobData::getDataInstance($dbObject->getReplyTo());
     $this->customHeaders = KalturaKeyValueArray::fromKeyValueArray($dbObject->getCustomHeaders());
     $this->contentParameters = KalturaKeyValueArray::fromKeyValueArray($dbObject->getContentParameters());
 }
 public function doFromObject($srcObj, KalturaDetachedResponseProfile $responseProfile = null)
 {
     /* @var $srcObj kHttpNotificationDispatchJobData */
     parent::doFromObject($srcObj, $responseProfile);
     if (is_null($this->data) && $srcObj->getDataObject()) {
         $dataObject = KalturaHttpNotificationData::getInstance($srcObj->getDataObject());
         if ($dataObject) {
             $this->data = $dataObject->getData($srcObj);
         }
     }
 }
 /**
  * Dispatch event notification object by id
  * 
  * @param int $id 
  * @param KalturaEventNotificationDispatchJobData $data 
  * @return int
  */
 function dispatch($id, KalturaEventNotificationDispatchJobData $data)
 {
     $kparams = array();
     $this->client->addParam($kparams, "id", $id);
     $this->client->addParam($kparams, "data", $data->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;
 }