Chris@0: t('Taxonomy terms are attached to nodes.'); Chris@0: $data['taxonomy_term_field_data']['table']['base']['access query tag'] = 'taxonomy_term_access'; Chris@0: $data['taxonomy_term_field_data']['table']['wizard_id'] = 'taxonomy_term'; Chris@0: Chris@0: $data['taxonomy_term_field_data']['table']['join'] = [ Chris@0: // This is provided for the many_to_one argument. Chris@0: 'taxonomy_index' => [ Chris@0: 'field' => 'tid', Chris@0: 'left_field' => 'tid', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['taxonomy_term_field_data']['tid']['help'] = $this->t('The tid of a taxonomy term.'); Chris@0: Chris@0: $data['taxonomy_term_field_data']['tid']['argument']['id'] = 'taxonomy'; Chris@0: $data['taxonomy_term_field_data']['tid']['argument']['name field'] = 'name'; Chris@0: $data['taxonomy_term_field_data']['tid']['argument']['zero is null'] = TRUE; Chris@0: Chris@0: $data['taxonomy_term_field_data']['tid']['filter']['id'] = 'taxonomy_index_tid'; Chris@0: $data['taxonomy_term_field_data']['tid']['filter']['title'] = $this->t('Term'); Chris@0: $data['taxonomy_term_field_data']['tid']['filter']['help'] = $this->t('Taxonomy term chosen from autocomplete or select widget.'); Chris@17: $data['taxonomy_term_field_data']['tid']['filter']['hierarchy table'] = 'taxonomy_term__parent'; Chris@0: $data['taxonomy_term_field_data']['tid']['filter']['numeric'] = TRUE; Chris@0: Chris@0: $data['taxonomy_term_field_data']['tid_raw'] = [ Chris@0: 'title' => $this->t('Term ID'), Chris@0: 'help' => $this->t('The tid of a taxonomy term.'), Chris@0: 'real field' => 'tid', Chris@0: 'filter' => [ Chris@0: 'id' => 'numeric', Chris@0: 'allow empty' => TRUE, Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['taxonomy_term_field_data']['tid_representative'] = [ Chris@0: 'relationship' => [ Chris@0: 'title' => $this->t('Representative node'), Chris@0: 'label' => $this->t('Representative node'), Chris@0: 'help' => $this->t('Obtains a single representative node for each term, according to a chosen sort criterion.'), Chris@0: 'id' => 'groupwise_max', Chris@0: 'relationship field' => 'tid', Chris@0: 'outer field' => 'taxonomy_term_field_data.tid', Chris@0: 'argument table' => 'taxonomy_term_field_data', Chris@0: 'argument field' => 'tid', Chris@0: 'base' => 'node_field_data', Chris@0: 'field' => 'nid', Chris@17: 'relationship' => 'node_field_data:term_node_tid', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['taxonomy_term_field_data']['vid']['help'] = $this->t('Filter the results of "Taxonomy: Term" to a particular vocabulary.'); Chris@17: $data['taxonomy_term_field_data']['vid']['field']['help'] = t('The vocabulary name.'); Chris@0: $data['taxonomy_term_field_data']['vid']['argument']['id'] = 'vocabulary_vid'; Chris@0: unset($data['taxonomy_term_field_data']['vid']['sort']); Chris@0: Chris@0: $data['taxonomy_term_field_data']['name']['field']['id'] = 'term_name'; Chris@0: $data['taxonomy_term_field_data']['name']['argument']['many to one'] = TRUE; Chris@0: $data['taxonomy_term_field_data']['name']['argument']['empty field name'] = $this->t('Uncategorized'); Chris@0: Chris@0: $data['taxonomy_term_field_data']['description__value']['field']['click sortable'] = FALSE; Chris@0: Chris@0: $data['taxonomy_term_field_data']['changed']['title'] = $this->t('Updated date'); Chris@0: $data['taxonomy_term_field_data']['changed']['help'] = $this->t('The date the term was last updated.'); Chris@0: Chris@0: $data['taxonomy_term_field_data']['changed_fulldate'] = [ Chris@0: 'title' => $this->t('Updated date'), Chris@0: 'help' => $this->t('Date in the form of CCYYMMDD.'), Chris@0: 'argument' => [ Chris@0: 'field' => 'changed', Chris@0: 'id' => 'date_fulldate', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['taxonomy_term_field_data']['changed_year_month'] = [ Chris@0: 'title' => $this->t('Updated year + month'), Chris@0: 'help' => $this->t('Date in the form of YYYYMM.'), Chris@0: 'argument' => [ Chris@0: 'field' => 'changed', Chris@0: 'id' => 'date_year_month', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['taxonomy_term_field_data']['changed_year'] = [ Chris@0: 'title' => $this->t('Updated year'), Chris@0: 'help' => $this->t('Date in the form of YYYY.'), Chris@0: 'argument' => [ Chris@0: 'field' => 'changed', Chris@0: 'id' => 'date_year', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['taxonomy_term_field_data']['changed_month'] = [ Chris@0: 'title' => $this->t('Updated month'), Chris@0: 'help' => $this->t('Date in the form of MM (01 - 12).'), Chris@0: 'argument' => [ Chris@0: 'field' => 'changed', Chris@0: 'id' => 'date_month', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['taxonomy_term_field_data']['changed_day'] = [ Chris@0: 'title' => $this->t('Updated day'), Chris@0: 'help' => $this->t('Date in the form of DD (01 - 31).'), Chris@0: 'argument' => [ Chris@0: 'field' => 'changed', Chris@0: 'id' => 'date_day', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['taxonomy_term_field_data']['changed_week'] = [ Chris@0: 'title' => $this->t('Updated week'), Chris@0: 'help' => $this->t('Date in the form of WW (01 - 53).'), Chris@0: 'argument' => [ Chris@0: 'field' => 'changed', Chris@0: 'id' => 'date_week', Chris@0: ], Chris@0: ]; Chris@0: Chris@17: $data['taxonomy_index']['table']['group'] = $this->t('Taxonomy term'); Chris@0: Chris@0: $data['taxonomy_index']['table']['join'] = [ Chris@0: 'taxonomy_term_field_data' => [ Chris@0: // links directly to taxonomy_term_field_data via tid Chris@0: 'left_field' => 'tid', Chris@0: 'field' => 'tid', Chris@0: ], Chris@0: 'node_field_data' => [ Chris@0: // links directly to node via nid Chris@0: 'left_field' => 'nid', Chris@0: 'field' => 'nid', Chris@0: ], Chris@17: 'taxonomy_term__parent' => [ Chris@17: 'left_field' => 'entity_id', Chris@0: 'field' => 'tid', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['taxonomy_index']['nid'] = [ Chris@0: 'title' => $this->t('Content with term'), Chris@0: 'help' => $this->t('Relate all content tagged with a term.'), Chris@0: 'relationship' => [ Chris@0: 'id' => 'standard', Chris@0: 'base' => 'node', Chris@0: 'base field' => 'nid', Chris@0: 'label' => $this->t('node'), Chris@0: 'skip base' => 'node', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: // @todo This stuff needs to move to a node field since really it's all Chris@0: // about nodes. Chris@0: $data['taxonomy_index']['tid'] = [ Chris@0: 'group' => $this->t('Content'), Chris@0: 'title' => $this->t('Has taxonomy term ID'), Chris@0: 'help' => $this->t('Display content if it has the selected taxonomy terms.'), Chris@0: 'argument' => [ Chris@0: 'id' => 'taxonomy_index_tid', Chris@0: 'name table' => 'taxonomy_term_field_data', Chris@0: 'name field' => 'name', Chris@0: 'empty field name' => $this->t('Uncategorized'), Chris@0: 'numeric' => TRUE, Chris@0: 'skip base' => 'taxonomy_term_field_data', Chris@0: ], Chris@0: 'filter' => [ Chris@0: 'title' => $this->t('Has taxonomy term'), Chris@0: 'id' => 'taxonomy_index_tid', Chris@17: 'hierarchy table' => 'taxonomy_term__parent', Chris@0: 'numeric' => TRUE, Chris@0: 'skip base' => 'taxonomy_term_field_data', Chris@0: 'allow empty' => TRUE, Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['taxonomy_index']['status'] = [ Chris@0: 'title' => $this->t('Publish status'), Chris@0: 'help' => $this->t('Whether or not the content related to a term is published.'), Chris@0: 'filter' => [ Chris@0: 'id' => 'boolean', Chris@0: 'label' => $this->t('Published status'), Chris@0: 'type' => 'yes-no', Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['taxonomy_index']['sticky'] = [ Chris@0: 'title' => $this->t('Sticky status'), Chris@0: 'help' => $this->t('Whether or not the content related to a term is sticky.'), Chris@0: 'filter' => [ Chris@0: 'id' => 'boolean', Chris@0: 'label' => $this->t('Sticky status'), Chris@0: 'type' => 'yes-no', Chris@0: ], Chris@0: 'sort' => [ Chris@0: 'id' => 'standard', Chris@0: 'help' => $this->t('Whether or not the content related to a term is sticky. To list sticky content first, set this to descending.'), Chris@0: ], Chris@0: ]; Chris@0: Chris@0: $data['taxonomy_index']['created'] = [ Chris@0: 'title' => $this->t('Post date'), Chris@0: 'help' => $this->t('The date the content related to a term was posted.'), Chris@0: 'sort' => [ Chris@17: 'id' => 'date', Chris@0: ], Chris@0: 'filter' => [ Chris@0: 'id' => 'date', Chris@0: ], Chris@0: ]; Chris@0: Chris@17: // Link to self through left.parent = right.tid (going down in depth). Chris@17: $data['taxonomy_term__parent']['table']['join']['taxonomy_term__parent'] = [ Chris@17: 'left_field' => 'entity_id', Chris@17: 'field' => 'parent_target_id', Chris@0: ]; Chris@0: Chris@17: $data['taxonomy_term__parent']['parent_target_id']['help'] = $this->t('The parent term of the term. This can produce duplicate entries if you are using a vocabulary that allows multiple parents.'); Chris@17: $data['taxonomy_term__parent']['parent_target_id']['relationship']['label'] = $this->t('Parent'); Chris@17: $data['taxonomy_term__parent']['parent_target_id']['argument']['id'] = 'taxonomy'; Chris@0: Chris@0: return $data; Chris@0: } Chris@0: Chris@0: }