ActivityStreamItem
in package
AbstractYes
Base class for activity stream items
All activity stream items share these common properties
Table of Contents
Properties
- $contextType : string
- $courseId : int|null
- $createdAt : string
- $groupId : int|null
- $htmlUrl : string
- $id : int
- $message : string
- $readState : bool
- $title : string
- $type : string
- $updatedAt : string
Methods
- __construct() : mixed
- Constructor
- createFromData() : ActivityStreamItem
- Create an activity stream item from data based on type
- getCreatedAtDate() : DateTimeInterface|null
- Get created at as DateTime
- getUpdatedAtDate() : DateTimeInterface|null
- Get updated at as DateTime
- isCourseItem() : bool
- Check if this is a course item
- isGroupItem() : bool
- Check if this is a group item
- isRead() : bool
- Check if the item is read
- toArray() : array<string, mixed>
- Convert to array
Properties
$contextType
public
string
$contextType
$courseId
public
int|null
$courseId
$createdAt
public
string
$createdAt
$groupId
public
int|null
$groupId
$htmlUrl
public
string
$htmlUrl
$id
public
int
$id
$message
public
string
$message
$readState
public
bool
$readState
$title
public
string
$title
$type
public
string
$type
$updatedAt
public
string
$updatedAt
Methods
__construct()
Constructor
public
__construct([array<string, mixed> $data = [] ]) : mixed
Parameters
- $data : array<string, mixed> = []
createFromData()
Create an activity stream item from data based on type
public
static createFromData(array<string, mixed> $data) : ActivityStreamItem
Parameters
- $data : array<string, mixed>
Return values
ActivityStreamItemgetCreatedAtDate()
Get created at as DateTime
public
getCreatedAtDate() : DateTimeInterface|null
Return values
DateTimeInterface|nullgetUpdatedAtDate()
Get updated at as DateTime
public
getUpdatedAtDate() : DateTimeInterface|null
Return values
DateTimeInterface|nullisCourseItem()
Check if this is a course item
public
isCourseItem() : bool
Return values
boolisGroupItem()
Check if this is a group item
public
isGroupItem() : bool
Return values
boolisRead()
Check if the item is read
public
isRead() : bool
Return values
booltoArray()
Convert to array
public
toArray() : array<string, mixed>