You are here

PrivateContent.php in Private content 8.2

File

src/Plugin/migrate/source/d6/PrivateContent.php
View source
<?php

namespace Drupal\private_content\Plugin\migrate\source\d6;

use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;

/**
 * Migrates private content.
 *
 * @MigrateSource(
 *   id = "d6_private_content",
 *   source_module = "private"
 * )
 */
class PrivateContent extends DrupalSqlBase {

  /**
   * {@inheritdoc}
   */
  public function query() {
    $query = $this
      ->select('private', 'p')
      ->fields('p', array(
      'nid',
      'private',
    ));
    return $query;
  }

  /**
   * {@inheritdoc}
   */
  public function fields() {
    return array(
      'nid' => $this
        ->t('The nid of a node'),
      'private' => $this
        ->t('The private status of a node'),
    );
  }

  /**
   * {@inheritdoc}
   */
  public function getIds() {
    $ids['nid']['type'] = 'integer';
    return $ids;
  }

}

Classes

Namesort descending Description
PrivateContent Migrates private content.