Apple News API PHP Client

CalendarEventAddition
in package
implements AdditionInterface

FinalYes

Calendar event addition for creating calendar events.

Allows users to add events to their calendar from text.

Tags
see
https://developer.apple.com/documentation/apple_news/calendareventaddition

Table of Contents

Interfaces

AdditionInterface
Interface for all addition types.

Properties

$endDate  : string|null
The event end date.
$location  : string|null
The event location.
$rangeLength  : int|null
The length of the range.
$rangeStart  : int|null
The start position of the range.
$startDate  : string
$title  : string|null
The event title.

Methods

__construct()  : mixed
Create a new CalendarEventAddition.
getType()  : string
Get the addition type identifier.
jsonSerialize()  : array<string, mixed>
{@inheritdoc}
setEndDate()  : $this
Set the event end date.
setLocation()  : $this
Set the event location.
setRange()  : $this
Set the text range.
setTitle()  : $this
Set the event title.
startingAt()  : self
Create a calendar event addition.

Properties

Methods

__construct()

Create a new CalendarEventAddition.

public __construct(string $startDate) : mixed
Parameters
$startDate : string

The event start date (ISO 8601).

getType()

Get the addition type identifier.

public getType() : string
Return values
string —

The addition type.

jsonSerialize()

{@inheritdoc}

public jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>

setEndDate()

Set the event end date.

public setEndDate(DateTimeInterface|string $endDate) : $this
Parameters
$endDate : DateTimeInterface|string

The end date.

Return values
$this

setLocation()

Set the event location.

public setLocation(string $location) : $this
Parameters
$location : string

The location.

Return values
$this

setRange()

Set the text range.

public setRange(int $start, int $length) : $this
Parameters
$start : int

The starting position.

$length : int

The length.

Return values
$this

setTitle()

Set the event title.

public setTitle(string $title) : $this
Parameters
$title : string

The title.

Return values
$this

startingAt()

Create a calendar event addition.

public static startingAt(DateTimeInterface|string $startDate) : self
Parameters
$startDate : DateTimeInterface|string

The start date.

Return values
self —

A new instance.


        
On this page

Search results