Author
in package
implements
JsonSerializable
Represents the author of a comment.
Interfaces, Classes, Traits and Enums
- JsonSerializable
Table of Contents
- $email : string
- The author's mail address.
- $ipAddress : string
- The author's IP address.
- $name : string
- The author's name. If you set it to `"viagra-test-123"`, Akismet will always return `true`.
- $role : string
- The author's role. If you set it to `"administrator"`, Akismet will always return `false`.
- $url : UriInterface|null
- The URL of the author's website.
- $userAgent : string
- The author's user agent, that is the string identifying the Web browser used to submit comments.
- __construct() : mixed
- Creates a new author.
- fromJson() : self
- Creates a new author from the specified JSON object.
- jsonSerialize() : stdClass
- Converts this object to a map in JSON format.
Properties
The author's mail address.
public
string
$email
$ipAddress
The author's IP address.
public
string
$ipAddress
$name
The author's name. If you set it to `"viagra-test-123"`, Akismet will always return `true`.
public
string
$name
$role
The author's role. If you set it to `"administrator"`, Akismet will always return `false`.
public
string
$role
$url
The URL of the author's website.
public
UriInterface|null
$url
$userAgent
The author's user agent, that is the string identifying the Web browser used to submit comments.
public
string
$userAgent
Methods
__construct()
Creates a new author.
public
__construct([string $email = "" ][, string $ipAddress = "" ][, string $name = "" ][, string $role = "" ][, string $url = "" ][, string $userAgent = "" ]) : mixed
Parameters
- $email : string = ""
-
The author's mail address.
- $ipAddress : string = ""
-
The author's IP address.
- $name : string = ""
-
The author's name. If you set it to
"viagra-test-123", Akismet will always returntrue. - $role : string = ""
-
The author's role. If you set it to
"administrator", Akismet will always returnfalse. - $url : string = ""
-
The URL of the author's website.
- $userAgent : string = ""
-
The author's user agent, that is the string identifying the Web browser used to submit comments.
Return values
mixed —fromJson()
Creates a new author from the specified JSON object.
public
static fromJson(object $json) : self
Parameters
- $json : object
-
A JSON object representing an author.
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.