/** * Store a notification to database. * * <code> * $userId = 1; * $note = "...."; * * $notification = new Prism\Integration\Notification\Gamification($userId, $note); * $notification->send(); * </code> * * @param string $content */ public function send($content = '') { if ($content !== '') { $this->content = $content; } $notification = new Notification($this->db); $notification->setContent($this->getContent()); $notification->setUserId($this->getUserId()); if ($this->title !== null) { $notification->setTitle($this->getTitle()); } if ($this->image !== null) { $notification->setImage($this->getImage()); } if ($this->url !== null) { $notification->setUrl($this->getUrl()); } $notification->store(); }
/** * Store a notification to database. * * <code> * $userId = 1; * $note = "...."; * * $notification = new Prism\Integration\Notification\Gamification($userId, $note); * $notification->send(); * </code> * * @param string $content */ public function send($content = '') { if (\JString::strlen($content) > 0) { $this->content = $content; } $notification = new Notification(\JFactory::getDbo()); $notification->setContent($this->getContent()); $notification->setUserId($this->getUserId()); if ($this->title !== null) { $notification->setTitle($this->getTitle()); } if ($this->image !== null) { $notification->setImage($this->getImage()); } if ($this->url !== null) { $notification->setUrl($this->getUrl()); } $notification->store(); }
/** * Store a notification to database. * * <code> * $userId = 1; * $note = "...."; * * $notification = new Prism\Integration\Notification\Gamification($userId, $note); * $notification->send(); * </code> * * @param string $content */ public function send($content = "") { if (!empty($note)) { $this->content = $content; } $notification = new Notification(\JFactory::getDbo()); $notification->setContent($this->getContent()); $notification->setUserId($this->getUserId()); if (!empty($this->title)) { $notification->setTitle($this->getTitle()); } if (!empty($this->image)) { $notification->setImage($this->getImage()); } if (!empty($this->url)) { $notification->setUrl($this->getUrl()); } $notification->store(); }