You are here

class ModerationStateSort in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/src/Plugin/views/sort/ModerationStateSort.php \Drupal\content_moderation\Plugin\views\sort\ModerationStateSort
  2. 9 core/modules/content_moderation/src/Plugin/views/sort/ModerationStateSort.php \Drupal\content_moderation\Plugin\views\sort\ModerationStateSort

Enables sorting for the computed moderation_state field.

Plugin annotation

@ViewsSort("moderation_state_sort");

Hierarchy

Expanded class hierarchy of ModerationStateSort

Related topics

File

core/modules/content_moderation/src/Plugin/views/sort/ModerationStateSort.php, line 17

Namespace

Drupal\content_moderation\Plugin\views\sort
View source
class ModerationStateSort extends SortPluginBase {
  use ModerationStateJoinViewsHandlerTrait;

  /**
   * The entity type manager.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * Creates an instance of ModerationStateFilter.
   *
   * @param array $configuration
   *   A configuration array containing information about the plugin instance.
   * @param string $plugin_id
   *   The plugin_id for the plugin instance.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->entityTypeManager = $entity_type_manager;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('entity_type.manager'));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ModerationStateJoinViewsHandlerTrait::ensureMyTable public function
ModerationStateSort::$entityTypeManager protected property The entity type manager.
ModerationStateSort::create public static function
ModerationStateSort::__construct public function Creates an instance of ModerationStateFilter.
SortPluginBase::adminSummary public function Display whether or not the sort order is ascending or descending.
SortPluginBase::buildExposeForm public function
SortPluginBase::buildOptionsForm public function Basic options for all sort criteria. 2
SortPluginBase::canExpose public function Determine if a sort can be exposed.
SortPluginBase::defaultExposeOptions public function Provide default options for exposed sorts.
SortPluginBase::defineOptions protected function 1
SortPluginBase::getCacheContexts public function The cache contexts associated with this object. Overrides CacheableDependencyInterface::getCacheContexts
SortPluginBase::getCacheMaxAge public function The maximum age for which this object may be cached. Overrides CacheableDependencyInterface::getCacheMaxAge
SortPluginBase::getCacheTags public function The cache tags associated with this object. Overrides CacheableDependencyInterface::getCacheTags
SortPluginBase::query public function Called to add the sort to a query. 6
SortPluginBase::showExposeButton public function Shortcut to display the expose/hide button.
SortPluginBase::showSortForm protected function Shortcut to display the value form.
SortPluginBase::sortOptions protected function Provide a list of options for the default sort form.
SortPluginBase::sortSubmit public function
SortPluginBase::sortValidate protected function
SortPluginBase::submitOptionsForm public function Simple submit handler.
SortPluginBase::trustedCallbacks public static function
SortPluginBase::validateExposeForm public function Validate the options form.
SortPluginBase::validateOptionsForm public function Simple validate handler.