ActiveTopicsBlock.php in Drupal 8
File
core/modules/forum/src/Plugin/Block/ActiveTopicsBlock.php
View source
<?php
namespace Drupal\forum\Plugin\Block;
use Drupal\Core\Database\Database;
class ActiveTopicsBlock extends ForumBlockBase {
protected function buildForumQuery() {
return Database::getConnection()
->select('forum_index', 'f')
->fields('f')
->addTag('node_access')
->addMetaData('base_table', 'forum_index')
->orderBy('f.last_comment_timestamp', 'DESC')
->range(0, $this->configuration['block_count']);
}
}