Documentation

CreateCalendarEventDTO extends AbstractBaseDto

CreateCalendarEventDTO

Data Transfer Object for creating calendar events in Canvas LMS. Handles the transformation of calendar event data into the multipart format expected by the Canvas API.

Table of Contents

Properties

$allDay  : bool|null
When true, event is considered to span the whole day and times are ignored
$blackoutDate  : bool|null
If true, this event represents a holiday or special day that does not count in course pacing
$childEventData  : array<string, DateTime, context_code?: string}>|null
Section-level child event data for course events Format: ['X' => ['start_at' => DateTime, 'end_at' => DateTime, 'context_code' => string]]
$contextCode  : string
Context code of the course, group, user, or account whose calendar this event should be added to Format: {type}_{id} (e.g., 'course_123', 'user_456', 'group_789', 'account_1')
$description  : string|null
Longer HTML description of the event
$duplicate  : array{count?: int, interval?: int, frequency?: string, append_iterator?: bool}|null
Duplication settings
$endAt  : DateTime|null
End date/time of the event
$locationAddress  : string|null
Location address
$locationName  : string|null
Location name of the event
$rrule  : string|null
The recurrence rule to create a series of recurring events iCalendar RRULE defining how the event repeats (unending series not supported)
$startAt  : DateTime|null
Start date/time of the event
$timeZoneEdited  : string|null
Time zone of the user editing the event Allowed time zones are IANA time zones or friendlier Ruby on Rails time zones
$title  : string|null
Short title for the calendar event
$apiPropertyName  : string
The name of the property in the API

Methods

__construct()  : mixed
BaseDto constructor.
toApiArray()  : array<int, array{name: string, contents: string}>
Convert DTO to API-compatible array format
toArray()  : array<string|int, mixed>
Convert the DTO to an array

Properties

$allDay

When true, event is considered to span the whole day and times are ignored

public bool|null $allDay = null

$blackoutDate

If true, this event represents a holiday or special day that does not count in course pacing

public bool|null $blackoutDate = null

$childEventData

Section-level child event data for course events Format: ['X' => ['start_at' => DateTime, 'end_at' => DateTime, 'context_code' => string]]

public array<string, DateTime, context_code?: string}>|null $childEventData = null

$contextCode

Context code of the course, group, user, or account whose calendar this event should be added to Format: {type}_{id} (e.g., 'course_123', 'user_456', 'group_789', 'account_1')

public string $contextCode

$duplicate

Duplication settings

public array{count?: int, interval?: int, frequency?: string, append_iterator?: bool}|null $duplicate = null

$rrule

The recurrence rule to create a series of recurring events iCalendar RRULE defining how the event repeats (unending series not supported)

public string|null $rrule = null

$timeZoneEdited

Time zone of the user editing the event Allowed time zones are IANA time zones or friendlier Ruby on Rails time zones

public string|null $timeZoneEdited = null

$apiPropertyName

The name of the property in the API

protected string $apiPropertyName = ''

Methods

__construct()

BaseDto constructor.

public __construct(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>
Tags
throws
Exception

toApiArray()

Convert DTO to API-compatible array format

public toApiArray() : array<int, array{name: string, contents: string}>
Return values
array<int, array{name: string, contents: string}>

toArray()

Convert the DTO to an array

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

        
On this page

Search results