NodeRevision.php

Same filename in this branch
  1. 11.x core/modules/node/src/Plugin/views/wizard/NodeRevision.php
  2. 11.x core/modules/node/src/Plugin/migrate/source/d6/NodeRevision.php
Same filename in other branches
  1. 9 core/modules/node/src/Plugin/views/wizard/NodeRevision.php
  2. 9 core/modules/node/src/Plugin/migrate/source/d6/NodeRevision.php
  3. 9 core/modules/node/src/Plugin/migrate/source/d7/NodeRevision.php
  4. 8.9.x core/modules/node/src/Plugin/views/wizard/NodeRevision.php
  5. 8.9.x core/modules/node/src/Plugin/migrate/source/d6/NodeRevision.php
  6. 8.9.x core/modules/node/src/Plugin/migrate/source/d7/NodeRevision.php
  7. 10 core/modules/node/src/Plugin/views/wizard/NodeRevision.php
  8. 10 core/modules/node/src/Plugin/migrate/source/d6/NodeRevision.php
  9. 10 core/modules/node/src/Plugin/migrate/source/d7/NodeRevision.php

Namespace

Drupal\node\Plugin\migrate\source\d7

File

core/modules/node/src/Plugin/migrate/source/d7/NodeRevision.php

View source
<?php

namespace Drupal\node\Plugin\migrate\source\d7;


/**
 * Drupal 7 node revision source from database.
 *
 * For available configuration keys, refer to the parent classes.
 *
 * @see \Drupal\migrate\Plugin\migrate\source\SqlBase
 * @see \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
 *
 * @MigrateSource(
 *   id = "d7_node_revision",
 *   source_module = "node"
 * )
 */
class NodeRevision extends Node {
    
    /**
     * The join options between the node and the node_revisions_table.
     */
    const JOIN = 'n.nid = nr.nid AND n.vid <> nr.vid';
    
    /**
     * {@inheritdoc}
     */
    public function fields() {
        // Use all the node fields plus the vid that identifies the version.
        return parent::fields() + [
            'vid' => $this->t('The primary identifier for this version.'),
            'log' => $this->t('Revision Log message'),
            'timestamp' => $this->t('Revision timestamp'),
        ];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getIds() {
        $ids['vid']['type'] = 'integer';
        $ids['vid']['alias'] = 'nr';
        return $ids;
    }

}

Classes

Title Deprecated Summary
NodeRevision Drupal 7 node revision source from database.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.