Documentation

CreateContentMigrationDTO extends AbstractBaseDto implements DTOInterface

Data Transfer Object for creating content migrations in Canvas LMS

This DTO handles the creation of new content migrations with support for various migration types, file uploads, settings, and date shifting options.

Table of Contents

Interfaces

DTOInterface

Properties

$dateShiftOptions  : array<string, mixed>|null
Date shift options for content migration
$migrationType  : string|null
The type of the migration (required) Allowed values: canvas_cartridge_importer, common_cartridge_importer, course_copy_importer, zip_file_importer, qti_converter, moodle_converter
$preAttachment  : array<string, mixed>|null
Pre-attachment array for file uploads Contains: name, size, content_type, etc.
$select  : array<string, array<string|int, string|int>>|null
Selection parameters for course copy migrations
$selectiveImport  : bool|null
Whether to perform selective import
$settings  : array<string, mixed>|null
Migration settings
$apiPropertyName  : string
The API property name for multipart requests

Methods

__construct()  : mixed
Constructor
addDaySubstitution()  : void
Add day substitution for date shifting
configureDateShifting()  : void
Configure date shifting
getDateShiftOptions()  : array<string, mixed>|null
getMigrationType()  : string|null
getPreAttachment()  : array<string, mixed>|null
getSelect()  : array<string, array<string|int, string|int>>|null
getSelectiveImport()  : bool|null
getSettings()  : array<string, mixed>|null
setCourseCopySource()  : void
Set course copy source
setDateShiftOptions()  : void
setFileUpload()  : void
Set file upload parameters
setFileUrl()  : void
Set file URL for import
setMigrationType()  : void
setPreAttachment()  : void
setSelect()  : void
setSelectiveImport()  : void
setSettings()  : void
toApiArray()  : array<int, array<string, mixed>>
Transform the DTO to the API-expected array format
toArray()  : array<string|int, mixed>
Convert the DTO to an array
validate()  : bool
Validate the DTO

Properties

$dateShiftOptions

Date shift options for content migration

public array<string, mixed>|null $dateShiftOptions = null

$migrationType

The type of the migration (required) Allowed values: canvas_cartridge_importer, common_cartridge_importer, course_copy_importer, zip_file_importer, qti_converter, moodle_converter

public string|null $migrationType = null

$preAttachment

Pre-attachment array for file uploads Contains: name, size, content_type, etc.

public array<string, mixed>|null $preAttachment = null

$select

Selection parameters for course copy migrations

public array<string, array<string|int, string|int>>|null $select = null

Methods

__construct()

Constructor

public __construct([array<string, mixed> $data = [] ]) : mixed
Parameters
$data : array<string, mixed> = []

addDaySubstitution()

Add day substitution for date shifting

public addDaySubstitution(int $fromDay, int $toDay) : void
Parameters
$fromDay : int

Day of week (0-6, 0=Sunday)

$toDay : int

Day of week (0-6, 0=Sunday)

configureDateShifting()

Configure date shifting

public configureDateShifting(bool $shiftDates[, string|null $oldStartDate = null ][, string|null $oldEndDate = null ][, string|null $newStartDate = null ][, string|null $newEndDate = null ]) : void
Parameters
$shiftDates : bool
$oldStartDate : string|null = null
$oldEndDate : string|null = null
$newStartDate : string|null = null
$newEndDate : string|null = null

getDateShiftOptions()

public getDateShiftOptions() : array<string, mixed>|null
Return values
array<string, mixed>|null

getPreAttachment()

public getPreAttachment() : array<string, mixed>|null
Return values
array<string, mixed>|null

getSelect()

public getSelect() : array<string, array<string|int, string|int>>|null
Return values
array<string, array<string|int, string|int>>|null

setCourseCopySource()

Set course copy source

public setCourseCopySource(int $sourceCourseId) : void
Parameters
$sourceCourseId : int

setDateShiftOptions()

public setDateShiftOptions(array<string, mixed>|null $dateShiftOptions) : void
Parameters
$dateShiftOptions : array<string, mixed>|null

setFileUpload()

Set file upload parameters

public setFileUpload(string $fileName, int $fileSize[, string|null $contentType = null ]) : void
Parameters
$fileName : string
$fileSize : int
$contentType : string|null = null

setFileUrl()

Set file URL for import

public setFileUrl(string $fileUrl) : void
Parameters
$fileUrl : string

setMigrationType()

public setMigrationType(string|null $migrationType) : void
Parameters
$migrationType : string|null

setPreAttachment()

public setPreAttachment(array<string, mixed>|null $preAttachment) : void
Parameters
$preAttachment : array<string, mixed>|null

setSelect()

public setSelect(array<string, array<string|int, string|int>>|null $select) : void
Parameters
$select : array<string, array<string|int, string|int>>|null

setSelectiveImport()

public setSelectiveImport(bool|null $selectiveImport) : void
Parameters
$selectiveImport : bool|null

setSettings()

public setSettings(array<string, mixed>|null $settings) : void
Parameters
$settings : array<string, mixed>|null

toApiArray()

Transform the DTO to the API-expected array format

public toApiArray() : array<int, array<string, mixed>>
Return values
array<int, array<string, mixed>>

toArray()

Convert the DTO to an array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results