class Thread
Same name and namespace in other branches
- 11.x core/modules/comment/src/Plugin/views/sort/Thread.php \Drupal\comment\Plugin\views\sort\Thread
Sort handler for ordering by thread.
Plugin annotation
@ViewsSort("comment_thread");
Hierarchy
- class \Drupal\Component\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
- class \Drupal\views\Plugin\views\PluginBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\views\Plugin\views\HandlerBase extends \Drupal\views\Plugin\views\ViewsHandlerInterface implements \Drupal\views\Plugin\views\PluginBase
- class \Drupal\views\Plugin\views\sort\SortPluginBase extends \Drupal\Core\Cache\CacheableDependencyInterface implements \Drupal\views\Plugin\views\HandlerBase
- class \Drupal\comment\Plugin\views\sort\Thread implements \Drupal\views\Plugin\views\sort\SortPluginBase
- class \Drupal\views\Plugin\views\sort\SortPluginBase extends \Drupal\Core\Cache\CacheableDependencyInterface implements \Drupal\views\Plugin\views\HandlerBase
- class \Drupal\views\Plugin\views\HandlerBase extends \Drupal\views\Plugin\views\ViewsHandlerInterface implements \Drupal\views\Plugin\views\PluginBase
- class \Drupal\views\Plugin\views\PluginBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of Thread
Related topics
17 string references to 'Thread'
- comment.views.schema.yml in core/
modules/ comment/ config/ schema/ comment.views.schema.yml - core/modules/comment/config/schema/comment.views.schema.yml
- Comment::getThread in core/
modules/ comment/ src/ Entity/ Comment.php - Returns the alphadecimal representation of the comment's place in a thread.
- Comment::query in core/
modules/ comment/ src/ Plugin/ migrate/ source/ d6/ Comment.php - Comment::setThread in core/
modules/ comment/ src/ Entity/ Comment.php - Sets the alphadecimal representation of the comment's place in a thread.
- CommentAccessControlHandler::checkFieldAccess in core/
modules/ comment/ src/ CommentAccessControlHandler.php
File
-
core/
modules/ comment/ src/ Plugin/ views/ sort/ Thread.php, line 14
Namespace
Drupal\comment\Plugin\views\sortView source
class Thread extends SortPluginBase {
public function query() {
$this->ensureMyTable();
// See \Drupal\comment\CommentStorage::loadThread() for an explanation of
// the thinking behind this sort.
if ($this->options['order'] == 'DESC') {
$this->query
->addOrderBy($this->tableAlias, $this->realField, $this->options['order']);
}
else {
$alias = $this->tableAlias . '_' . $this->realField . 'asc';
// @todo is this secure?
$this->query
->addOrderBy(NULL, "SUBSTRING({$this->tableAlias}.{$this->realField}, 1, (LENGTH({$this->tableAlias}.{$this->realField}) - 1))", $this->options['order'], $alias);
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.