コード例 #1
0
 public function schedule($operation, $facts = null)
 {
     $scheduler = new SchedulerReportOperation();
     $scheduler->setOperation($operation);
     $scheduler->setInterval('1 hour');
     $scheduler->setEndAction($operation->getActivity()->getCampaign());
     $this->em->persist($scheduler);
     $facts[self::METRIC_LIKES] = 0;
     $facts[self::METRIC_COMMENTS] = 0;
     $factService = $this->container->get('campaignchain.core.fact');
     $factService->addFacts('activity', self::OPERATION_BUNDLE_NAME, $operation, $facts);
 }
コード例 #2
0
 public function schedule($operation, $facts = null)
 {
     $scheduler = new SchedulerReportOperation();
     $scheduler->setOperation($operation);
     $scheduler->setInterval('1 hour');
     $scheduler->setEndAction($operation->getActivity()->getCampaign());
     $this->em->persist($scheduler);
     // Add initial data to report.
     $this->newsitem = $this->em->getRepository('CampaignChainOperationLinkedInBundle:NewsItem')->findOneByOperation($operation);
     if (!$this->newsitem) {
         throw new \Exception('No Linkedin news item found for an operation with ID: ' . $operation->getId());
     }
     $facts[self::METRIC_LIKES] = 0;
     $facts[self::METRIC_COMMENTS] = 0;
     $this->factService->addFacts('activity', self::BUNDLE_NAME, $operation, $facts);
 }
コード例 #3
0
 public function schedule($operation, $facts = null)
 {
     $scheduler = new SchedulerReportOperation();
     $scheduler->setOperation($operation);
     $scheduler->setInterval('1 hour');
     $scheduler->setEndAction($operation->getActivity()->getCampaign());
     $this->em->persist($scheduler);
     // Add initial data to report.
     $this->status = $this->em->getRepository('CampaignChainOperationTwitterBundle:Status')->findOneByOperation($operation);
     if (!$this->status) {
         throw new \Exception('No status message found for an operation with ID: ' . $operation->getId());
     }
     $facts[self::METRIC_RTS] = 0;
     $facts[self::METRIC_FAVS] = 0;
     $factService = $this->container->get('campaignchain.core.fact');
     $factService->addFacts('activity', self::BUNDLE_NAME, $operation, $facts);
 }
コード例 #4
0
 public function schedule($operation, $facts = null)
 {
     $scheduler = new SchedulerReportOperation();
     $scheduler->setOperation($operation);
     $scheduler->setInterval('1 hour');
     $scheduler->setEndAction($operation->getActivity()->getCampaign());
     $this->em->persist($scheduler);
     $facts[self::METRIC_UNSUBSCRIBES] = 0;
     $facts[self::METRIC_OPENS] = 0;
     $facts[self::METRIC_UNIQUE_OPENS] = 0;
     $facts[self::METRIC_CLICKS] = 0;
     $facts[self::METRIC_UNIQUE_CLICKS] = 0;
     $facts[self::METRIC_EMAILS_SENT] = 0;
     $facts[self::METRIC_USERS_WHO_CLICKED] = 0;
     $factService = $this->container->get('campaignchain.core.fact');
     $factService->addFacts('activity', self::OPERATION_BUNDLE_NAME, $operation, $facts);
 }
コード例 #5
0
 public function schedule($operation, $facts = null)
 {
     // Create the report scheduler.
     $scheduler = new SchedulerReportOperation();
     $scheduler->setOperation($operation);
     $datetimeUtil = $this->container->get('campaignchain.core.util.datetime');
     $scheduler->setStartDate($datetimeUtil->getUserNow());
     $scheduler->setInterval('1 hour');
     $scheduler->setEndAction($operation->getActivity());
     /*
      * To get the number of attendees after the Webinar ended, we make sure
      * the scheduler runs 1 more time after the Webinar is done.
      */
     $scheduler->setProlongation('5 minutes');
     $scheduler->setProlongationInterval('4 minutes');
     $this->em->persist($scheduler);
     $factService = $this->container->get('campaignchain.core.fact');
     $factService->addFacts('activity', self::OPERATION_BUNDLE_NAME, $operation, $facts);
 }