You are here

CourseObjectFulfillment.php in Course 3.x

File

modules/course_migrate/src/Plugin/migrate/source/CourseObjectFulfillment.php
View source
<?php

namespace Drupal\course_migrate\Plugin\migrate\source;

use Drupal\Core\Database\Query\SelectInterface;
use Drupal\migrate_drupal\Plugin\migrate\source\d7\FieldableEntity;

/**
 * Drupal 7 course object fulfillment source from database.
 *
 * @MigrateSource(
 *   id = "d7_course_object_fulfillment",
 *   core = {7},
 *   source_module = "course",
 *   destination_module = "course"
 * )
 */
class CourseObjectFulfillment extends FieldableEntity {

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

  /**
   * {@inheritdoc}
   */
  public function query() {
    $query = $this
      ->select('course_outline_fulfillment', 'cof')
      ->fields('cof');
    return $query;
  }
  public function fields() {
    return [
      'cofid' => 'Course object fulfillment ID',
      'coid' => 'Course object ID',
      'uid' => 'User ID',
      'complete' => 'Complete',
      'grade_result' => 'Grade result',
      'date_started' => 'Date started',
      'date_completed' => 'Date completed',
      'info' => 'Object data',
      'uuid' => 'uuid',
      'instance' => 'Instance',
    ];
  }

}

Classes

Namesort descending Description
CourseObjectFulfillment Drupal 7 course object fulfillment source from database.