Documentation

UpdateTabDTO extends AbstractBaseDto
in package

Data Transfer Object for updating a Canvas Tab

This DTO handles the data structure for updating Canvas tabs. Only position and hidden properties can be updated according to Canvas API.

Usage: $updateDto = new UpdateTabDTO(position: 3, hidden: false); $tab = Tab::update('assignments', $updateDto);

Table of Contents

Properties

$hidden  : bool|null
$position  : int|null
$apiPropertyName  : string
The name of the property in the API

Methods

__construct()  : mixed
Create a new UpdateTabDTO instance
getHidden()  : bool|null
Get the hidden status
getPosition()  : int|null
Get the position
setHidden()  : void
Set the hidden status
setPosition()  : void
Set the position
toApiArray()  : array<string|int, array<string, mixed>>
Convert to API multipart format
toArray()  : array<string, mixed>
Convert to array for API requests

Properties

$apiPropertyName

The name of the property in the API

protected string $apiPropertyName = 'tab'

Methods

__construct()

Create a new UpdateTabDTO instance

public __construct([int|null $position = null ][, bool|null $hidden = null ]) : mixed
Parameters
$position : int|null = null

Position of the tab (1-based, max 50)

$hidden : bool|null = null

Whether the tab should be hidden

Tags
throws
CanvasApiException

If position is invalid

getHidden()

Get the hidden status

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

getPosition()

Get the position

public getPosition() : int|null
Return values
int|null

setHidden()

Set the hidden status

public setHidden(bool|null $hidden) : void
Parameters
$hidden : bool|null

setPosition()

Set the position

public setPosition(int|null $position) : void
Parameters
$position : int|null

Position (1-based, max 50)

Tags
throws
CanvasApiException

If position is invalid

toApiArray()

Convert to API multipart format

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

toArray()

Convert to array for API requests

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

        
On this page

Search results