public function __construct(array $categoryIDs) { parent::__construct(); if (!empty($categoryIDs)) { $this->getConditionBuilder()->add('news_to_category.categoryID IN (?)', array($categoryIDs)); $this->getConditionBuilder()->add('news.newsID = news_to_category.newsID'); } else { $this->getConditionBuilder()->add('1=0'); } foreach ($categoryIDs as $categoryID) { $category = new NewsCategory(CategoryHandler::getInstance()->getCategory($categoryID)); if (!$category->getPermission('canViewDelayedNews')) { $this->getConditionBuilder()->add('news.isDisabled = ?', array(0)); } } }
public function __construct(Tag $tag) { parent::__construct(); $this->getConditionBuilder()->add('tag_to_object.objectTypeID = ? AND tag_to_object.languageID = ? AND tag_to_object.tagID = ?', array(TagEngine::getInstance()->getObjectTypeID('de.codequake.cms.news'), $tag->languageID, $tag->tagID)); $this->getConditionBuilder()->add('news.newsID = tag_to_object.objectID'); }