Post class.
More...
|
| __construct (int $id, int $discussionid, int $parentid, int $authorid, int $timecreated, int $timemodified, bool $mailed, string $subject, string $message, int $messageformat, bool $messagetrust, bool $hasattachments, int $totalscore, bool $mailnow, bool $deleted, int $privatereplyto, ?int $wordcount, ?int $charcount) |
| Constructor.
|
|
| get_age () |
| Get the post's age in seconds.
|
|
| get_author_id () |
| Get the id of the user that authored the post.
|
|
| get_charcount () |
| Returns the char count.
|
|
| get_discussion_id () |
| Get the discussion id.
|
|
| get_id () |
| Get the post id.
|
|
| get_message () |
| Get the post message.
|
|
| get_message_format () |
| Get the post message format.
|
|
| get_parent_id () |
| Get the id of the parent post.
|
|
| get_private_reply_recipient_id () |
| Get the id of the user that this post was intended for.
|
|
| get_subject () |
| Get the post subject.
|
|
| get_time_created () |
| Get the timestamp for when this post was created.
|
|
| get_time_modified () |
| Get the timestamp for when this post was last modified.
|
|
| get_total_score () |
| Get the total score.
|
|
| get_wordcount () |
| Returns the word count.
|
|
| has_attachments () |
| Does this post have attachments?
|
|
| has_been_mailed () |
| Has this post been mailed?
|
|
| has_parent () |
| Does this post have a parent? I.e.
|
|
| is_deleted () |
| Is this post deleted?
|
|
| is_message_trusted () |
| Is this a trusted message? I.e.
|
|
| is_owned_by_user (stdClass $user) |
| Check if the given user authored this post.
|
|
| is_private_reply () |
| Is this post private?
|
|
| is_private_reply_intended_for_user (stdClass $user) |
| Check if the given post is a private reply intended for the given user.
|
|
| should_mail_now () |
| Should this post be mailed now?
|
|
|
static | add_message_counts (\stdClass $record) |
| This methods adds/updates forum posts' word count and char count attributes based on $data->message.
|
|
◆ __construct()
mod_forum\local\entities\post::__construct |
( |
int | $id, |
|
|
int | $discussionid, |
|
|
int | $parentid, |
|
|
int | $authorid, |
|
|
int | $timecreated, |
|
|
int | $timemodified, |
|
|
bool | $mailed, |
|
|
string | $subject, |
|
|
string | $message, |
|
|
int | $messageformat, |
|
|
bool | $messagetrust, |
|
|
bool | $hasattachments, |
|
|
int | $totalscore, |
|
|
bool | $mailnow, |
|
|
bool | $deleted, |
|
|
int | $privatereplyto, |
|
|
?int | $wordcount, |
|
|
?int | $charcount ) |
Constructor.
- Parameters
-
int | $id | ID |
int | $discussionid | The id of the discussion this post belongs to |
int | $parentid | The id of the post that this post is replying to. Zero if it isn't a reply. |
int | $authorid | The id of user who authored the post |
int | $timecreated | Timestamp for when the post was created |
int | $timemodified | Timestamp for when the post last modified |
bool | $mailed | If the post has been mailed |
string | $subject | Post subject |
string | $message | Post message |
int | $messageformat | Format of the post message |
bool | $messagetrust | Is this a trusted message, i.e. created by a trusted user. |
bool | $hasattachments | Does the post have attachments |
int | $totalscore | Total score |
bool | $mailnow | Should this post be mailed immediately |
bool | $deleted | Is the post deleted |
int | $privatereplyto | Which user this reply is intended for in a private reply situation |
◆ add_message_counts()
static mod_forum\local\entities\post::add_message_counts |
( |
\stdClass | $record | ) |
|
|
static |
This methods adds/updates forum posts' word count and char count attributes based on $data->message.
- Parameters
-
stdClass | $record | A record ready to be inserted / updated in DB. |
- Return values
-
◆ get_age()
mod_forum\local\entities\post::get_age |
( |
| ) |
|
Get the post's age in seconds.
- Return values
-
◆ get_author_id()
mod_forum\local\entities\post::get_author_id |
( |
| ) |
|
Get the id of the user that authored the post.
- Return values
-
◆ get_charcount()
mod_forum\local\entities\post::get_charcount |
( |
| ) |
|
Returns the char count.
- Return values
-
◆ get_discussion_id()
mod_forum\local\entities\post::get_discussion_id |
( |
| ) |
|
Get the discussion id.
- Return values
-
◆ get_id()
mod_forum\local\entities\post::get_id |
( |
| ) |
|
Get the post id.
- Return values
-
◆ get_message()
mod_forum\local\entities\post::get_message |
( |
| ) |
|
Get the post message.
- Return values
-
◆ get_message_format()
mod_forum\local\entities\post::get_message_format |
( |
| ) |
|
Get the post message format.
- Return values
-
◆ get_parent_id()
mod_forum\local\entities\post::get_parent_id |
( |
| ) |
|
Get the id of the parent post.
Returns zero if this post is not a reply.
- Return values
-
◆ get_private_reply_recipient_id()
mod_forum\local\entities\post::get_private_reply_recipient_id |
( |
| ) |
|
Get the id of the user that this post was intended for.
- Return values
-
◆ get_subject()
mod_forum\local\entities\post::get_subject |
( |
| ) |
|
Get the post subject.
- Return values
-
◆ get_time_created()
mod_forum\local\entities\post::get_time_created |
( |
| ) |
|
Get the timestamp for when this post was created.
- Return values
-
◆ get_time_modified()
mod_forum\local\entities\post::get_time_modified |
( |
| ) |
|
Get the timestamp for when this post was last modified.
- Return values
-
◆ get_total_score()
mod_forum\local\entities\post::get_total_score |
( |
| ) |
|
Get the total score.
- Return values
-
◆ get_wordcount()
mod_forum\local\entities\post::get_wordcount |
( |
| ) |
|
Returns the word count.
- Return values
-
◆ has_attachments()
mod_forum\local\entities\post::has_attachments |
( |
| ) |
|
Does this post have attachments?
- Return values
-
◆ has_been_mailed()
mod_forum\local\entities\post::has_been_mailed |
( |
| ) |
|
Has this post been mailed?
- Return values
-
◆ has_parent()
mod_forum\local\entities\post::has_parent |
( |
| ) |
|
Does this post have a parent? I.e.
is it a reply?
- Return values
-
◆ is_deleted()
mod_forum\local\entities\post::is_deleted |
( |
| ) |
|
Is this post deleted?
- Return values
-
◆ is_message_trusted()
mod_forum\local\entities\post::is_message_trusted |
( |
| ) |
|
Is this a trusted message? I.e.
was it authored by a trusted user?
- Return values
-
◆ is_owned_by_user()
mod_forum\local\entities\post::is_owned_by_user |
( |
stdClass | $user | ) |
|
Check if the given user authored this post.
- Parameters
-
stdClass | $user | The user to check. |
- Return values
-
◆ is_private_reply()
mod_forum\local\entities\post::is_private_reply |
( |
| ) |
|
Is this post private?
- Return values
-
◆ is_private_reply_intended_for_user()
mod_forum\local\entities\post::is_private_reply_intended_for_user |
( |
stdClass | $user | ) |
|
Check if the given post is a private reply intended for the given user.
- Parameters
-
stdClass | $user | The user to check. |
- Return values
-
◆ should_mail_now()
mod_forum\local\entities\post::should_mail_now |
( |
| ) |
|
Should this post be mailed now?
- Return values
-
The documentation for this class was generated from the following file:
- mod/forum/classes/local/entities/post.php