3 namespace Drupal\taxonomy\Plugin\views\argument;
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
9 * Argument handler for to modify depth for a previous term.
11 * This handler is actually part of the node table and has some restrictions,
12 * because it uses a subquery to find nodes with.
14 * @ingroup views_argument_handlers
16 * @ViewsArgument("taxonomy_index_tid_depth_modifier")
18 class IndexTidDepthModifier extends ArgumentPluginBase {
20 public function buildOptionsForm(&$form, FormStateInterface $form_state) { }
22 public function query($group_by = FALSE) { }
24 public function preQuery() {
25 // We don't know our argument yet, but it's based upon our position:
26 $argument = isset($this->view->args[$this->position]) ? $this->view->args[$this->position] : NULL;
27 if (!is_numeric($argument)) {
35 if ($argument < -10) {
39 // figure out which argument preceded us.
40 $keys = array_reverse(array_keys($this->view->argument));
42 foreach ($keys as $key) {
43 if ($key == $this->options['id']) {
52 if (empty($this->view->argument[$key])) {
56 if (isset($handler)) {
60 $handler = &$this->view->argument[$key];
61 if (empty($handler->definition['accept depth modifier'])) {
66 $handler->options['depth'] = $argument;