class ModerationStateField in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_moderation/src/Plugin/views/field/ModerationStateField.php \Drupal\content_moderation\Plugin\views\field\ModerationStateField
- 9 core/modules/content_moderation/src/Plugin/views/field/ModerationStateField.php \Drupal\content_moderation\Plugin\views\field\ModerationStateField
A field handler for the computed moderation_state field.
Plugin annotation
@ViewsField("moderation_state_field");
Hierarchy
- class \Drupal\content_moderation\Plugin\views\field\ModerationStateField extends \Drupal\views\Plugin\views\field\EntityField uses ModerationStateJoinViewsHandlerTrait
Expanded class hierarchy of ModerationStateField
File
- core/
modules/ content_moderation/ src/ Plugin/ views/ field/ ModerationStateField.php, line 15
Namespace
Drupal\content_moderation\Plugin\views\fieldView source
class ModerationStateField extends EntityField {
use ModerationStateJoinViewsHandlerTrait;
/**
* {@inheritdoc}
*/
public function clickSort($order) {
$this
->ensureMyTable();
// This could be derived from the content_moderation_state entity table
// mapping, however this is an internal entity type whose storage should
// remain constant.
$storage = $this->entityTypeManager
->getStorage('content_moderation_state');
$storage_definition = $this->entityFieldManager
->getActiveFieldStorageDefinitions('content_moderation_state')['moderation_state'];
$column_name = $storage
->getTableMapping()
->getFieldColumnName($storage_definition, 'value');
$this->aliases[$column_name] = $this->tableAlias . '.' . $column_name;
$this->query
->addOrderBy(NULL, NULL, $order, $this->aliases[$column_name]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ModerationStateField:: |
public | function | ||
ModerationStateJoinViewsHandlerTrait:: |
public | function |