예제 #1
0
 public function callback(Information $info, ArrangeInterface $caller)
 {
     $packet = new ArrangePacket();
     $packet->setExternalId(mt_rand(0, 9));
     $packet->setExternalTypeId(2);
     $packet->setPriority(1);
     $packet->setStartingDateTime(date('Y-m-d H:i:s'));
     $packet->setExternalData('test');
     $caller->setPacket($packet);
     if ($caller->isLastOperationSucceeded()) {
         // Ok
     }
 }
 public function callback(Information $info, ArrangeInterface $caller)
 {
     $packet = new ArrangePacket();
     $packet->setExternalId(10);
     $packet->setExternalTypeId(2);
     $packet->setPriority(1);
     $packet->setTypeId(Task::TYPE_ID_RECURRENT);
     $packet->setRepeatingInterval(900);
     // Every 15 minutes
     $packet->setStartingDateTime(date('Y-m-d H:i:s'));
     $packet->setExternalData('test-' . mt_rand(0, 999999));
     $caller->setPacket($packet, true);
     if ($caller->isLastOperationSucceeded()) {
         // Ok
     }
 }