protected function NodeRevision::defaultDisplayFiltersUser in Drupal 9
Same name and namespace in other branches
- 8 core/modules/node/src/Plugin/views/wizard/NodeRevision.php \Drupal\node\Plugin\views\wizard\NodeRevision::defaultDisplayFiltersUser()
Retrieves filter information based on user input for the default display.
Parameters
array $form: The full wizard form array.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the wizard form.
Return value
array An array of filter arrays keyed by ID. A sort array contains the options accepted by a filter handler.
Overrides WizardPluginBase::defaultDisplayFiltersUser
File
- core/
modules/ node/ src/ Plugin/ views/ wizard/ NodeRevision.php, line 102
Class
- NodeRevision
- Tests creating node revision views with the wizard.
Namespace
Drupal\node\Plugin\views\wizardCode
protected function defaultDisplayFiltersUser(array $form, FormStateInterface $form_state) {
$filters = [];
$type = $form_state
->getValue([
'show',
'type',
]);
if ($type && $type != 'all') {
$filters['type'] = [
'id' => 'type',
'table' => 'node_field_data',
'field' => 'type',
'relationship' => 'nid',
'value' => [
$type => $type,
],
'entity_type' => 'node',
'entity_field' => 'type',
'plugin_id' => 'bundle',
];
}
return $filters;
}