public function __invoke($args)
 {
     if (count($args) < 2) {
         throw new OrongoScriptParseException("Arguments missing for Notification.Notify()");
     }
     $title = isset($args[2]) ? $args[2] : "OrongoCMS";
     $image = isset($args[3]) ? $args[3] : null;
     $time = isset($args[4]) && is_numeric($args[4]) ? intval($args[4]) : 10000;
     $n = new OrongoNotification($title, $args[1], $image, $time);
     $n->dispatch(new User($args[0]));
 }
Exemple #2
0
 /**
  * Shortcut for notifying user 
  * @param String $paramTitle title of notification
  * @param String $paramText text of notification
  * @param String $paramImage image url for notification [optional]
  * @param int $paramTime duration of notification (default = 10000 ms)
  */
 public function notify($paramTitle, $paramText, $paramImage = null, $paramTime = 10000)
 {
     $n = new OrongoNotification($paramTitle, $paramText, $paramImage, $paramTime);
     $n->dispatch($this);
 }