CourseObject.php in Course 3.x
File
modules/course_migrate/src/Plugin/migrate/source/CourseObject.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;
class CourseObject extends FieldableEntity {
public function getIds() {
$ids = [];
$ids['coid']['type'] = 'integer';
return $ids;
}
public function query() {
$query = $this
->select('course_outline', 'co')
->fields('co');
$query
->join('node', 'n', 'co.nid = n.nid');
return $query;
}
public function fields() {
return [
'coid' => 'Course object ID',
'nid' => 'Course node ID',
'module' => 'Object module',
'title' => 'Object title',
'object_type' => 'Object type',
'enabled' => 'Enabled',
'info' => '???',
'instance' => 'Instance',
'required' => 'Required',
'weight' => 'Weight',
'hidden' => 'Hidden',
'duration' => 'Duration',
'uuid' => 'UUID',
'data' => 'Object data',
];
}
}