Issue
in package
implements
JsonSerializable
Issue information for magazine and periodical content.
Use this class to associate articles with specific publication issues, allowing Apple News to group related content together.
Tags
Table of Contents
Interfaces
- JsonSerializable
Properties
- $issueDate : string|null
- The publication date of the issue.
- $issueIdentifier : string|null
- The unique identifier for the issue.
- $issueName : string|null
- The display name of the issue.
Methods
- fromArray() : self
- Create an Issue from an array of data.
- isEmpty() : bool
- Check if the issue has any data set.
- jsonSerialize() : array<string, string>
- {@inheritdoc}
- setIssueDate() : $this
- Set the publication date of the issue.
- setIssueIdentifier() : $this
- Set the unique identifier for this issue.
- setIssueName() : $this
- Set the display name of the issue.
Properties
$issueDate
The publication date of the issue.
private
string|null
$issueDate
= null
$issueIdentifier
The unique identifier for the issue.
private
string|null
$issueIdentifier
= null
$issueName
The display name of the issue.
private
string|null
$issueName
= null
Methods
fromArray()
Create an Issue from an array of data.
public
static fromArray(array<string, mixed> $data) : self
Parameters
- $data : array<string, mixed>
-
The issue data.
Return values
self —A new Issue instance.
isEmpty()
Check if the issue has any data set.
public
isEmpty() : bool
Return values
bool —True if at least one field is set.
jsonSerialize()
{@inheritdoc}
public
jsonSerialize() : array<string, string>
Return values
array<string, string>setIssueDate()
Set the publication date of the issue.
public
setIssueDate(DateTimeInterface|string $date) : $this
Parameters
- $date : DateTimeInterface|string
-
The issue date as a DateTime object or ISO 8601 string.
Return values
$thissetIssueIdentifier()
Set the unique identifier for this issue.
public
setIssueIdentifier(string $identifier) : $this
This identifier should be unique within your channel and consistent across all articles belonging to the same issue.
Parameters
- $identifier : string
-
The unique issue identifier.
Return values
$thissetIssueName()
Set the display name of the issue.
public
setIssueName(string $name) : $this
This is the human-readable name shown to users, such as "January 2024" or "Summer Edition".
Parameters
- $name : string
-
The issue display name.