TopicMessage
extends Message
in package
Message that is sent to a specific topic.
Table of Contents
Properties
Methods
- __construct() : mixed
- getId() : int
- Get the id of this message.
- getTopic() : string
- Returns the topic.
- toArray() : array<string|int, mixed>
- Returns the message as an array in the format as expected by the Google API.
Properties
$body
private
string
$body
$id
private
int
$id
$title
private
string
$title
$topic
private
string
$topic
Methods
__construct()
public
__construct(int $id, string $topic, string $body, string $title) : mixed
Parameters
- $id : int
-
A unique identifier for this message, for example use a primary key from your database.
- $topic : string
-
The topic.
- $body : string
-
The message body content.
- $title : string
-
The message title.
getId()
Get the id of this message.
public
getId() : int
Return values
intgetTopic()
Returns the topic.
public
getTopic() : string
Return values
stringtoArray()
Returns the message as an array in the format as expected by the Google API.
public
toArray() : array<string|int, mixed>