Conversation
in package
Represents a collection of related personal messages.
Table of Contents
Properties
- $head : int
- $latest : int
- $pms : array<string|int, mixed>
- $started_by_me : bool
- $recent : array<string|int, mixed>
Methods
- __construct() : mixed
- Constructor.
- count() : int
- Counts the visible conversations in the specified folder and/or label.
- getRecent() : array<string|int, mixed>
- Gets the latest posts for conversations in a folder.
Properties
$head
public
int
$head
ID number of the PM that started this conversation.
$latest
public
int
$latest
ID number of the latest PM in this conversation.
$pms
public
array<string|int, mixed>
$pms
= []
Info about who sent and received each PM in this conversation.
Keys are ID numbers of PMs. Values are arrays with sender and recipient IDs.
$started_by_me
public
bool
$started_by_me
Whether the current user started this conversation.
$recent
protected
static array<string|int, mixed>
$recent
= []
Holds the results of Received::getRecent().
The keys of this array are string representations of the parameters that Received::getRecent() was called with. The values are key-value pairs that match those parameters, where each key-value pair is the ID of the head PM and the latest PM in a conversation.
Methods
__construct()
Constructor.
public
__construct(int $pm) : mixed
Parameters
- $pm : int
-
The ID number of any PM in the conversation.
count()
Counts the visible conversations in the specified folder and/or label.
public
static count([bool $inbox = true ][, int $label = -1 ]) : int
Parameters
- $inbox : bool = true
-
Whether we're viewing the inbox or sent items.
- $label : int = -1
-
The ID of the label being viewed, or -1 for no label. Does nothing if $inbox is false.
Return values
int —The number of conversations in the current folder/label view.
getRecent()
Gets the latest posts for conversations in a folder.
public
static getRecent([bool $inbox = true ][, int $label = -1 ][, string $sort = 'pm.id_pm' ][, bool $descending = false ][, int $limit = 0 ][, int $offset = 0 ]) : array<string|int, mixed>
Parameters
- $inbox : bool = true
-
Whether we're viewing the inbox or sent items.
- $label : int = -1
-
The ID of the label being viewed, or -1 for no label. Does nothing if $folder == 'sent'.
- $sort : string = 'pm.id_pm'
-
Instructions on how to sort the results.
- $descending : bool = false
-
Whether to sort in descending order.
- $limit : int = 0
-
The max number of results to retrieve. Zero = no limit.
- $offset : int = 0
-
Offset where we should begin retrieving results. Does nothing if $limit == 0.
Return values
array<string|int, mixed> —Keys are head PMs, values are latest PMs.