コード例 #1
0
 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     $prefix = null;
     $notData = new kNotificationJobData();
     $notData->setData('');
     $notData->setType(kNotificationJobData::NOTIFICATION_TYPE_TEST);
     $notData->setUserId($puser_id);
     $job = new BatchJob();
     $job->setId(kNotificationJobData::NOTIFICATION_TYPE_TEST + (int) time());
     $job->setData($notData);
     $job->setPartnerId($partner_id);
     $partner = PartnerPeer::retrieveByPK($partner_id);
     list($url, $signature_key) = myNotificationMgr::getPartnerNotificationInfo($partner);
     list($params, $raw_siganture) = myNotificationMgr::prepareNotificationData($url, $signature_key, $job, $prefix);
     $this->send($url, $params);
 }
コード例 #2
0
ファイル: kJobsManager.php プロジェクト: ace3535/server
 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);
 }