Term
in package
Term Object
Represents an enrollment term in Canvas LMS. This is a read-only object that is embedded within Course responses.
Table of Contents
Properties
- $endAt : string|null
- The end date of the term
- $id : int|null
- The unique identifier for the term
- $name : string|null
- The name of the term
- $startAt : string|null
- The start date of the term
Methods
- __construct() : mixed
- Constructor
- getEndAt() : string|null
- Get the end date
- getId() : int|null
- Get the term ID
- getName() : string|null
- Get the term name
- getStartAt() : string|null
- Get the start date
- hasEnded() : bool
- Check if term has ended
- hasStarted() : bool
- Check if term has started
- isActive() : bool
- Check if term is active
- setEndAt() : void
- Set the end date
- setId() : void
- Set the term ID
- setName() : void
- Set the term name
- setStartAt() : void
- Set the start date
- toArray() : array<string|int, mixed>
- Convert to array
Properties
$endAt
The end date of the term
public
string|null
$endAt
= null
$id
The unique identifier for the term
public
int|null
$id
= null
$name
The name of the term
public
string|null
$name
= null
$startAt
The start date of the term
public
string|null
$startAt
= null
Methods
__construct()
Constructor
public
__construct([array<string|int, mixed> $data = [] ]) : mixed
Parameters
- $data : array<string|int, mixed> = []
getEndAt()
Get the end date
public
getEndAt() : string|null
Return values
string|nullgetId()
Get the term ID
public
getId() : int|null
Return values
int|nullgetName()
Get the term name
public
getName() : string|null
Return values
string|nullgetStartAt()
Get the start date
public
getStartAt() : string|null
Return values
string|nullhasEnded()
Check if term has ended
public
hasEnded() : bool
Return values
boolhasStarted()
Check if term has started
public
hasStarted() : bool
Return values
boolisActive()
Check if term is active
public
isActive() : bool
Return values
boolsetEndAt()
Set the end date
public
setEndAt(string|null $endAt) : void
Parameters
- $endAt : string|null
setId()
Set the term ID
public
setId(int|null $id) : void
Parameters
- $id : int|null
setName()
Set the term name
public
setName(string|null $name) : void
Parameters
- $name : string|null
setStartAt()
Set the start date
public
setStartAt(string|null $startAt) : void
Parameters
- $startAt : string|null
toArray()
Convert to array
public
toArray() : array<string|int, mixed>