f3296c234d52f7688bd001216f661ea003336a06
[yaffs-website] / web / core / modules / node / src / Plugin / migrate / source / d6 / NodeRevision.php
1 <?php
2
3 namespace Drupal\node\Plugin\migrate\source\d6;
4 use Drupal\Core\Database\Query\SelectInterface;
5
6 /**
7  * Drupal 6 node revision source from database.
8  *
9  * @MigrateSource(
10  *   id = "d6_node_revision"
11  * )
12  */
13 class NodeRevision extends Node {
14
15   /**
16    * The join options between the node and the node_revisions_table.
17    */
18   const JOIN = 'n.nid = nr.nid AND n.vid <> nr.vid';
19
20   /**
21    * {@inheritdoc}
22    */
23   public function fields() {
24     // Use all the node fields plus the vid that identifies the version.
25     return parent::fields() + [
26       'vid' => t('The primary identifier for this version.'),
27       'log' => $this->t('Revision Log message'),
28       'timestamp' => $this->t('Revision timestamp'),
29     ];
30   }
31
32   /**
33    * {@inheritdoc}
34    */
35   public function getIds() {
36     $ids['vid']['type'] = 'integer';
37     $ids['vid']['alias'] = 'nr';
38     return $ids;
39   }
40
41   /**
42    * {@inheritdoc}
43    */
44   protected function handleTranslations(SelectInterface $query) {
45     // @todo in https://www.drupal.org/node/2746541
46   }
47
48 }