Akismet for PHP

Comment
in package
implements JsonSerializable

Represents a comment submitted by an author.

Interfaces, Classes, Traits and Enums

JsonSerializable

Table of Contents

$author  : Author|null
The comment's author.
$content  : string
The comment's content.
$date  : DateTimeInterface|null
The UTC timestamp of the creation of the comment.
$permalink  : UriInterface|null
The permanent location of the entry the comment is submitted to.
$postModified  : DateTimeInterface|null
The UTC timestamp of the publication time for the post, page or thread on which the comment was posted.
$recheckReason  : string
A string describing why the content is being rechecked.
$referrer  : UriInterface|null
The URL of the webpage that linked to the entry being requested.
$type  : string
The comment's type.
__construct()  : mixed
Creates a new comment.
fromJson()  : self
Creates a new comment from the specified JSON object.
jsonSerialize()  : stdClass
Converts this object to a map in JSON format.

Properties

$content

The comment's content.

public string $content

$date

The UTC timestamp of the creation of the comment.

public DateTimeInterface|null $date

The permanent location of the entry the comment is submitted to.

public UriInterface|null $permalink

$postModified

The UTC timestamp of the publication time for the post, page or thread on which the comment was posted.

public DateTimeInterface|null $postModified

$recheckReason

A string describing why the content is being rechecked.

public string $recheckReason

$referrer

The URL of the webpage that linked to the entry being requested.

public UriInterface|null $referrer

$type

The comment's type.

public string $type = ""

Methods

__construct()

Creates a new comment.

public __construct(Author|null $author[, string $content = "" ][, DateTimeInterface|null $date = null ][, string $permalink = "" ][, DateTimeInterface|null $postModified = null ][, string $recheckReason = "" ][, string $referrer = "" ][, string $type = "" ]) : mixed
Parameters
$author : Author|null

The comment's author.

$content : string = ""

The comment's content.

$date : DateTimeInterface|null = null

The UTC timestamp of the creation of the comment.

$permalink : string = ""

The permanent location of the entry the comment is submitted to.

$postModified : DateTimeInterface|null = null

The UTC timestamp of the publication time for the post, page or thread on which the comment was posted.

$recheckReason : string = ""

A string describing why the content is being rechecked.

$referrer : string = ""

The URL of the webpage that linked to the entry being requested.

$type : string = ""

The comment's type.

Return values
mixed

fromJson()

Creates a new comment from the specified JSON object.

public static fromJson(object $json) : self
Parameters
$json : object

A JSON object representing a comment.

Return values
self

The instance corresponding to the specified JSON object.

jsonSerialize()

Converts this object to a map in JSON format.

public jsonSerialize() : stdClass
Return values
stdClass

The map in JSON format corresponding to this object.

Search results