Documentation

CreateAdminDTO extends AbstractBaseDto
in package
implements DTOInterface

Data Transfer Object for creating a new Canvas admin

Table of Contents

Interfaces

DTOInterface

Properties

$role  : string|int|null
The role to give the user. Can be a string role name or integer role ID
$roleId  : int|null
The ID of the role to assign. Alternative to using role name
$sendConfirmation  : bool|null
Send a notification email to the new admin (defaults to true)
$userId  : int
The ID of the user to be made an admin
$apiPropertyName  : string
The name of the property in the API

Methods

__construct()  : mixed
BaseDto constructor.
getRole()  : string|int|null
Get the role
getRoleId()  : int|null
Get the role ID
getSendConfirmation()  : bool|null
Get send confirmation flag
getUserId()  : int
Get the user ID
setRole()  : self
Set the role
setRoleId()  : self
Set the role ID
setSendConfirmation()  : self
Set send confirmation flag
setUserId()  : self
Set the user ID
toApiArray()  : array<int, array{name: string, contents: mixed}>
Convert the DTO to an array for API requests
toArray()  : array<string|int, mixed>
Convert the DTO to an array

Properties

$role

The role to give the user. Can be a string role name or integer role ID

public string|int|null $role = null

$roleId

The ID of the role to assign. Alternative to using role name

public int|null $roleId = null

$sendConfirmation

Send a notification email to the new admin (defaults to true)

public bool|null $sendConfirmation = null

$userId

The ID of the user to be made an admin

public int $userId

$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

getRole()

Get the role

public getRole() : string|int|null
Return values
string|int|null

getRoleId()

Get the role ID

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

getSendConfirmation()

Get send confirmation flag

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

getUserId()

Get the user ID

public getUserId() : int
Return values
int

setRole()

Set the role

public setRole(string|int|null $role) : self
Parameters
$role : string|int|null
Return values
self

setRoleId()

Set the role ID

public setRoleId(int|null $roleId) : self
Parameters
$roleId : int|null
Return values
self

setSendConfirmation()

Set send confirmation flag

public setSendConfirmation(bool|null $sendConfirmation) : self
Parameters
$sendConfirmation : bool|null
Return values
self

setUserId()

Set the user ID

public setUserId(int $userId) : self
Parameters
$userId : int
Return values
self

toApiArray()

Convert the DTO to an array for API requests

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