Documentation

CreatePageDTO extends AbstractBaseDto
in package
implements DTOInterface

Data Transfer Object for creating pages in Canvas LMS

This DTO handles the creation of new pages with all the necessary fields supported by the Canvas API.

Table of Contents

Interfaces

DTOInterface

Properties

$body  : string
Page body content (HTML)
$editingRoles  : string|null
Who can edit the page (teachers, students, members, public)
$frontPage  : bool|null
Whether this page is the front page for the course
$notifyOfUpdate  : bool|null
Whether to notify users of the page creation
$publishAt  : string|null
Scheduled publication date
$published  : bool|null
Whether the page is published
$title  : string
Page title (required)
$apiPropertyName  : string
The API property name for multipart requests

Methods

__construct()  : mixed
Constructor with validation
getBody()  : string
Get page body
getEditingRoles()  : string|null
Get editing roles
getFrontPage()  : bool|null
Get front page status
getNotifyOfUpdate()  : bool|null
Get notify of update status
getPublishAt()  : string|null
Get publish at date
getPublished()  : bool|null
Get published status
getTitle()  : string
Get page title
setBody()  : void
Set page body
setEditingRoles()  : void
Set editing roles
setFrontPage()  : void
Set front page status
setNotifyOfUpdate()  : void
Set notify of update status
setPublishAt()  : void
Set publish at date
setPublished()  : void
Set published status
setTitle()  : void
Set page title
toApiArray()  : array<string|int, mixed>
Convert the DTO to an array for API requests
toArray()  : array<string|int, mixed>
Convert the DTO to an array

Properties

$editingRoles

Who can edit the page (teachers, students, members, public)

public string|null $editingRoles = null

$frontPage

Whether this page is the front page for the course

public bool|null $frontPage = null

$notifyOfUpdate

Whether to notify users of the page creation

public bool|null $notifyOfUpdate = null

$publishAt

Scheduled publication date

public string|null $publishAt = null

$published

Whether the page is published

public bool|null $published = null

$apiPropertyName

The API property name for multipart requests

protected string $apiPropertyName = 'wiki_page'

Methods

__construct()

Constructor with validation

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

Initial data

Tags
throws
InvalidArgumentException

If required fields are missing

getBody()

Get page body

public getBody() : string
Return values
string

getEditingRoles()

Get editing roles

public getEditingRoles() : string|null
Return values
string|null

getFrontPage()

Get front page status

public getFrontPage() : bool|null
Return values
bool|null

getNotifyOfUpdate()

Get notify of update status

public getNotifyOfUpdate() : bool|null
Return values
bool|null

getPublishAt()

Get publish at date

public getPublishAt() : string|null
Return values
string|null

getPublished()

Get published status

public getPublished() : bool|null
Return values
bool|null

getTitle()

Get page title

public getTitle() : string
Return values
string

setBody()

Set page body

public setBody(string $body) : void
Parameters
$body : string

setEditingRoles()

Set editing roles

public setEditingRoles(string|null $editingRoles) : void
Parameters
$editingRoles : string|null

setFrontPage()

Set front page status

public setFrontPage(bool|null $frontPage) : void
Parameters
$frontPage : bool|null

setNotifyOfUpdate()

Set notify of update status

public setNotifyOfUpdate(bool|null $notifyOfUpdate) : void
Parameters
$notifyOfUpdate : bool|null

setPublishAt()

Set publish at date

public setPublishAt(string|null $publishAt) : void
Parameters
$publishAt : string|null

setPublished()

Set published status

public setPublished(bool|null $published) : void
Parameters
$published : bool|null

setTitle()

Set page title

public setTitle(string $title) : void
Parameters
$title : string

toApiArray()

Convert the DTO to an array for API requests

public toApiArray() : array<string|int, mixed>
Return values
array<string|int, 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