コード例 #1
0
ファイル: DocumentRepository.php プロジェクト: rutgerkok/rCMS
 public function whereRaw($sql, $params)
 {
     // Overridden to modify SQL, so that hidden articles stay hidden
     if (!$this->showHiddenDocuments) {
         if (!empty($sql)) {
             $sql = "({$sql}) AND ";
         }
         $sql .= "`{$this->hiddenField->getNameInDatabase()}` = 0";
     }
     return parent::whereRaw($sql, $params);
 }
コード例 #2
0
ファイル: ArticleRepository.php プロジェクト: rutgerkok/rCMS
 protected function whereRaw($sql, $params)
 {
     // Remove hidden articles for normal visitors
     if (!$this->website->isLoggedInAsStaff()) {
         if (!empty($sql)) {
             $sql = "({$sql}) AND ";
         }
         $sql .= "`{$this->hiddenField->getNameInDatabase()}` = 0";
     }
     // Get query
     $query = parent::whereRaw($sql, $params);
     // Set default limit
     $query->limit(9);
     return $query;
 }