CalendarEventAddition
in package
implements
AdditionInterface
FinalYes
Calendar event addition for creating calendar events.
Allows users to add events to their calendar from text.
Tags
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
$endDate
The event end date.
private
string|null
$endDate
= null
$location
The event location.
private
string|null
$location
= null
$rangeLength
The length of the range.
private
int|null
$rangeLength
= null
$rangeStart
The start position of the range.
private
int|null
$rangeStart
= null
$startDate read-only
private
string
$startDate
$title
The event title.
private
string|null
$title
= null
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
$thissetLocation()
Set the event location.
public
setLocation(string $location) : $this
Parameters
- $location : string
-
The location.
Return values
$thissetRange()
Set the text range.
public
setRange(int $start, int $length) : $this
Parameters
- $start : int
-
The starting position.
- $length : int
-
The length.
Return values
$thissetTitle()
Set the event title.
public
setTitle(string $title) : $this
Parameters
- $title : string
-
The title.
Return values
$thisstartingAt()
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.