protected function getMessage(kScope $scope) { if ($scope instanceof kEventScope) { $object = $scope->getObject(); } // prepare vars as configured by user in admin console $objectType = $this->getApiObjectType(); $format = $this->getObjectFormat(); return call_user_func(kCurrentContext::$serializeCallback, $object, $objectType, $format); }
protected function dispatchJob(kScope $scope, kEventNotificationDispatchJobData $jobData, $eventNotificationType = null) { $entryId = null; $parentJob = null; if ($scope instanceof kEventScope) { $event = $scope->getEvent(); if ($event instanceof kApplicativeEvent) { $parentJob = $event->getRaisedJob(); } $object = $scope->getObject(); if ($object instanceof entry) { $entryId = $object->getId(); } elseif (method_exists($object, 'getEntryId')) { $entryId = $object->getEntryId(); } } if (!$eventNotificationType) { $eventNotificationType = $this->getType(); } $job = $this->addEventNotificationDispatchJob($eventNotificationType, $jobData, $scope->getPartnerId(), $entryId, $parentJob); return $job->getId(); }