class NewTopicsBlock
Same name in other branches
- 9 core/modules/forum/src/Plugin/Block/NewTopicsBlock.php \Drupal\forum\Plugin\Block\NewTopicsBlock
- 10 core/modules/forum/src/Plugin/Block/NewTopicsBlock.php \Drupal\forum\Plugin\Block\NewTopicsBlock
- 11.x core/modules/forum/src/Plugin/Block/NewTopicsBlock.php \Drupal\forum\Plugin\Block\NewTopicsBlock
Provides a 'New forum topics' block.
Plugin annotation
@Block(
id = "forum_new_block",
admin_label = @Translation("New 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\NewTopicsBlock 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 NewTopicsBlock
File
-
core/
modules/ forum/ src/ Plugin/ Block/ NewTopicsBlock.php, line 16
Namespace
Drupal\forum\Plugin\BlockView source
class NewTopicsBlock 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.created', 'DESC')
->range(0, $this->configuration['block_count']);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
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 | ||
NewTopicsBlock::buildForumQuery | protected | function | Builds the select query to use for this forum block. | Overrides ForumBlockBase::buildForumQuery |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.