Esempio n. 1
0
 public function addSubscriber($user_id)
 {
     tables\UserArticles::getTable()->addStarredArticle($user_id, $this->getID());
 }
Esempio n. 2
0
 /**
  * Removes an article from the list of flagged articles
  *
  * @param framework\Event $event
  */
 public function User__removeStarredArticle(framework\Event $event)
 {
     $user = $event->getSubject();
     $arguments = $event->getParameters();
     $article_id = $arguments[0];
     UserArticles::getTable()->removeStarredArticle($user->getID(), $article_id);
     if (isset($user->_starredarticles)) {
         $articles = $user->_retrieve('publish', 'starredarticles');
         unset($articles[$article_id]);
         $user->_store('publish', 'starredarticles', $articles);
     }
     $event->setProcessed();
     $event->setReturnValue(true);
 }