/** * Store a notification to database. * * <code> * $userId = 1; * $content = "...."; * * $notification = new Prism\Integration\Notification\SocialCommunity($userId, $content); * $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->content); $notification->setUserId($this->user_id); if ($this->image !== null) { $notification->setImage($this->image); } if ($this->url !== null) { $notification->setUrl($this->url); } $notification->store(); }
/** * Store a notification to database. * * <code> * $userId = 1; * $content = "...."; * * $notification = new Prism\Integration\Notification\SocialCommunity($userId, $content); * $notification->send(); * </code> * * @param string $content */ public function send($content = "") { if (!empty($content)) { $this->content = $content; } $notification = new Notification(\JFactory::getDbo()); $notification->setContent($this->content); $notification->setUserId($this->user_id); if (!empty($this->image)) { $notification->setImage($this->image); } if (!empty($this->url)) { $notification->setUrl($this->url); } $notification->store(); }