class ActiveTopicsBlock
Same name in other branches
- 9 core/modules/forum/src/Plugin/Block/ActiveTopicsBlock.php \Drupal\forum\Plugin\Block\ActiveTopicsBlock
- 10 core/modules/forum/src/Plugin/Block/ActiveTopicsBlock.php \Drupal\forum\Plugin\Block\ActiveTopicsBlock
- 11.x core/modules/forum/src/Plugin/Block/ActiveTopicsBlock.php \Drupal\forum\Plugin\Block\ActiveTopicsBlock
Provides an 'Active forum topics' block.
Plugin annotation
@Block(
id = "forum_active_block",
admin_label = @Translation("Active forum topics"),
category = @Translation("Lists (Views)")
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Component\Plugin\ContextAwarePluginBase extends \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\ContextAwarePluginInterface
- class \Drupal\Core\Plugin\ContextAwarePluginBase extends \Drupal\Component\Plugin\ContextAwarePluginBase implements \Drupal\Core\Plugin\ContextAwarePluginInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\TypedData\TypedDataTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\Core\Block\BlockBase extends \Drupal\Core\Plugin\ContextAwarePluginBase implements \Drupal\Core\Block\BlockPluginInterface, \Drupal\Core\Plugin\PluginWithFormsInterface, \Drupal\Core\Render\PreviewFallbackInterface uses \Drupal\Core\Block\BlockPluginTrait, \Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait
- class \Drupal\forum\Plugin\Block\ForumBlockBase extends \Drupal\Core\Block\BlockBase
- class \Drupal\forum\Plugin\Block\ActiveTopicsBlock extends \Drupal\forum\Plugin\Block\ForumBlockBase
- class \Drupal\forum\Plugin\Block\ForumBlockBase extends \Drupal\Core\Block\BlockBase
- class \Drupal\Core\Block\BlockBase extends \Drupal\Core\Plugin\ContextAwarePluginBase implements \Drupal\Core\Block\BlockPluginInterface, \Drupal\Core\Plugin\PluginWithFormsInterface, \Drupal\Core\Render\PreviewFallbackInterface uses \Drupal\Core\Block\BlockPluginTrait, \Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait
- class \Drupal\Core\Plugin\ContextAwarePluginBase extends \Drupal\Component\Plugin\ContextAwarePluginBase implements \Drupal\Core\Plugin\ContextAwarePluginInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\TypedData\TypedDataTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\Component\Plugin\ContextAwarePluginBase extends \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\ContextAwarePluginInterface
Expanded class hierarchy of ActiveTopicsBlock
File
-
core/
modules/ forum/ src/ Plugin/ Block/ ActiveTopicsBlock.php, line 16
Namespace
Drupal\forum\Plugin\BlockView source
class ActiveTopicsBlock extends ForumBlockBase {
/**
* {@inheritdoc}
*/
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']);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
ActiveTopicsBlock::buildForumQuery | protected | function | Builds the select query to use for this forum block. | Overrides ForumBlockBase::buildForumQuery |
ForumBlockBase::blockAccess | protected | function | ||
ForumBlockBase::blockForm | public | function | ||
ForumBlockBase::blockSubmit | public | function | ||
ForumBlockBase::build | public | function | ||
ForumBlockBase::defaultConfiguration | public | function | ||
ForumBlockBase::getCacheContexts | public | function | ||
ForumBlockBase::getCacheTags | public | function |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.