You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.5 KiB
57 lines
1.5 KiB
<?php
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
namespace Chamilo\PluginBundle\MigrationMoodle\Task;
|
|
|
|
use Chamilo\PluginBundle\MigrationMoodle\Extractor\CourseExtractor;
|
|
use Chamilo\PluginBundle\MigrationMoodle\Loader\CourseSectionsLoader;
|
|
use Chamilo\PluginBundle\MigrationMoodle\Transformer\BaseTransformer;
|
|
use Chamilo\PluginBundle\MigrationMoodle\Transformer\Property\LoadedCourseCodeLookup;
|
|
|
|
/**
|
|
* Class CourseSectionsTask.
|
|
*
|
|
* Task to convert Moodle course sections in a Chamilo learning paths.
|
|
*
|
|
* @package Chamilo\PluginBundle\MigrationMoodle\Task
|
|
*/
|
|
class CourseSectionsTask extends BaseTask
|
|
{
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getExtractConfiguration()
|
|
{
|
|
return [
|
|
'class' => CourseExtractor::class,
|
|
'query' => "SELECT id, course, summary FROM mdl_course_sections WHERE section > 0 AND (name != '' OR name IS NOT NULL)",
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getTransformConfiguration()
|
|
{
|
|
return [
|
|
'class' => BaseTransformer::class,
|
|
'map' => [
|
|
'c_id' => [
|
|
'class' => LoadedCourseCodeLookup::class,
|
|
'properties' => ['course'],
|
|
],
|
|
'description' => 'summary',
|
|
],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getLoadConfiguration()
|
|
{
|
|
return [
|
|
'class' => CourseSectionsLoader::class,
|
|
];
|
|
}
|
|
}
|
|
|