Esempio n. 1
0
 protected function init(&$row, $dbType)
 {
     parent::init($row, $dbType);
     $this->score = $row->ct_score;
     $this->price = $row->ct_price;
     $this->rank = $row->ct_rank;
 }
Esempio n. 2
0
 public function canView(WAPArticle &$article)
 {
     $adminGroup = WAPDB::getInstance($this->dbType)->getWAPConfig()->getWikiHowAdminGroupName();
     if ($this->inGroup($adminGroup)) {
         $viewable = true;
     } else {
         if (($article->isAssigned() || $article->isCompleted()) && $this->getId() == $article->getUserId()) {
             // Viewable if the article is assigned to or completed by user
             $viewable = true;
         } else {
             // See if there is a tag intersection.
             $viewable = false;
             $tags = $article->getRawTags();
             foreach ($tags as $tag) {
                 if ($this->hasTag($tag)) {
                     $viewable = true;
                     break;
                 }
             }
         }
     }
     return $viewable;
 }