Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / taxonomy / src / Plugin / migrate / source / d6 / VocabularyPerType.php
1 <?php
2
3 namespace Drupal\taxonomy\Plugin\migrate\source\d6;
4
5 /**
6  * Gets all the vocabularies based on the node types that have Taxonomy enabled.
7  *
8  * @MigrateSource(
9  *   id = "d6_taxonomy_vocabulary_per_type",
10  *   source_provider = "taxonomy"
11  * )
12  */
13 class VocabularyPerType extends Vocabulary {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function query() {
19     $query = parent::query();
20     $query->join('vocabulary_node_types', 'nt', 'v.vid = nt.vid');
21     $query->fields('nt', ['type']);
22     return $query;
23   }
24
25   /**
26    * {@inheritdoc}
27    */
28   public function getIds() {
29     $ids['vid']['type'] = 'integer';
30     $ids['vid']['alias'] = 'nt';
31     $ids['type']['type'] = 'string';
32     return $ids;
33   }
34
35 }