/** * Saves this notification to the database so it can be sent to the remote * system later. If a response could not be confirmed, the message remains * queued and will be resent with the system event cron until received. * * @param SystemEventInstance $system_event_instance * @return SystemEventInstanceMessage */ public function saveSystemEventNotification($system_event_instance) { $system_event_instance_message = new \SystemEventInstanceMessage(); $system_event_instance_message->setSystemEventInstance($system_event_instance); $system_event_instance_message->setSystemEventSubscription($this); $system_event_instance_message->save(); //try to sent the notification, mark as sent if successful. try { //this is handled by the cron now } catch (\Exception $e) { //do nothing; cron will try to resend any unset } return $system_event_instance_message; }