CreateCalendarEventDTO
extends AbstractBaseDto
in package
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
$description
Longer HTML description of the event
public
string|null
$description
= null
$duplicate
Duplication settings
public
array{count?: int, interval?: int, frequency?: string, append_iterator?: bool}|null
$duplicate
= null
$endAt
End date/time of the event
public
DateTime|null
$endAt
= null
$locationAddress
Location address
public
string|null
$locationAddress
= null
$locationName
Location name of the event
public
string|null
$locationName
= 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
$startAt
Start date/time of the event
public
DateTime|null
$startAt
= 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
$title
Short title for the calendar event
public
string|null
$title
= 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
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>