CreateAdminDTO
extends AbstractBaseDto
in package
implements
DTOInterface
Data Transfer Object for creating a new Canvas admin
Table of Contents
Interfaces
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
getRole()
Get the role
public
getRole() : string|int|null
Return values
string|int|nullgetRoleId()
Get the role ID
public
getRoleId() : int|null
Return values
int|nullgetSendConfirmation()
Get send confirmation flag
public
getSendConfirmation() : bool|null
Return values
bool|nullgetUserId()
Get the user ID
public
getUserId() : int
Return values
intsetRole()
Set the role
public
setRole(string|int|null $role) : self
Parameters
- $role : string|int|null
Return values
selfsetRoleId()
Set the role ID
public
setRoleId(int|null $roleId) : self
Parameters
- $roleId : int|null
Return values
selfsetSendConfirmation()
Set send confirmation flag
public
setSendConfirmation(bool|null $sendConfirmation) : self
Parameters
- $sendConfirmation : bool|null
Return values
selfsetUserId()
Set the user ID
public
setUserId(int $userId) : self
Parameters
- $userId : int
Return values
selftoApiArray()
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>