IndexTidDepthModifier.php in Drupal 9
File
core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepthModifier.php
View source
<?php
namespace Drupal\taxonomy\Plugin\views\argument;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
class IndexTidDepthModifier extends ArgumentPluginBase {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
}
public function query($group_by = FALSE) {
}
public function preQuery() {
$argument = isset($this->view->args[$this->position]) ? $this->view->args[$this->position] : NULL;
if (!is_numeric($argument)) {
return;
}
if ($argument > 10) {
$argument = 10;
}
if ($argument < -10) {
$argument = -10;
}
$keys = array_reverse(array_keys($this->view->argument));
$skip = TRUE;
foreach ($keys as $key) {
if ($key == $this->options['id']) {
$skip = FALSE;
continue;
}
if ($skip) {
continue;
}
if (empty($this->view->argument[$key])) {
continue;
}
if (isset($handler)) {
unset($handler);
}
$handler =& $this->view->argument[$key];
if (empty($handler->definition['accept depth modifier'])) {
continue;
}
$handler->options['depth'] = $argument;
}
}
}