Example #1
0
 public static function addNotificationJob(BatchJob $parentJob = null, $entryId, $partnerId, $notificationType, $sendType, $puserId, $objectId, $notificationData)
 {
     $jobData = new kNotificationJobData();
     $jobData->setType($notificationType);
     $jobData->setSendType($sendType);
     $jobData->setUserId($puserId);
     $jobData->setObjectId($objectId);
     $jobData->setData($notificationData);
     $batchJob = null;
     if ($parentJob) {
         $batchJob = $parentJob->createChild(BatchJobType::NOTIFICATION, $notificationType);
     } else {
         $batchJob = new BatchJob();
         $batchJob->setEntryId($entryId);
         $batchJob->setPartnerId($partnerId);
     }
     if ($sendType == kNotificationJobData::NOTIFICATION_MGR_NO_SEND || $sendType == kNotificationJobData::NOTIFICATION_MGR_SEND_SYNCH) {
         $batchJob->setStatus(BatchJob::BATCHJOB_STATUS_DONT_PROCESS);
     }
     return self::addJob($batchJob, $jobData, BatchJobType::NOTIFICATION, $notificationType);
 }