You are here

protected function NewTopicsBlock::buildForumQuery in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/forum/src/Plugin/Block/NewTopicsBlock.php \Drupal\forum\Plugin\Block\NewTopicsBlock::buildForumQuery()

Builds the select query to use for this forum block.

Return value

\Drupal\Core\Database\Query\Select A Select object.

Overrides ForumBlockBase::buildForumQuery

File

core/modules/forum/src/Plugin/Block/NewTopicsBlock.php, line 24
Contains \Drupal\forum\Plugin\Block\NewTopicsBlock.

Class

NewTopicsBlock
Provides a 'New forum topics' block.

Namespace

Drupal\forum\Plugin\Block

Code

protected function buildForumQuery() {
  return db_select('forum_index', 'f')
    ->fields('f')
    ->addTag('node_access')
    ->addMetaData('base_table', 'forum_index')
    ->orderBy('f.created', 'DESC')
    ->range(0, $this->configuration['block_count']);
}