class Event extends SchemaObject

Properties

protected string $type from  SchemaObject
protected array<string, mixed> $properties from  SchemaObject
static protected array<class-string<static>, string> $types from  SchemaObject

Methods

__construct(string|null $type = null)

Create a schema with an explicit or inferred type.

set(string $property, mixed $value)

Set a schema property, coercing nested schema objects and dates.

date(string $property, DateTimeInterface|string $date)

Set a date property using an ISO 8601 value.

array
toArray()

Get the schema type and properties.

array
toJsonLd()

Get the schema with its JSON-LD context.

array
jsonSerialize()

Get the schema's JSON representation.

__call(string $method, array $parameters)

Dynamically set the schema property named by the called method.

mixed
coerce(mixed $value)

Normalize nested schemas and dates into their serialized values.

string
typeFromAttribute()

Resolve the schema.org type from the SchemaType attribute or the class name.

static void
flushState()

Flush all static state.

description(string $description)

Set the event description.

doorTime(DateTimeInterface|string $doorTime)

Set the time admission begins.

endDate(DateTimeInterface|string $endDate)

Set the event end date.

eventAttendanceMode(EventAttendanceMode $mode)

Set the event attendance mode.

eventStatus(EventStatus $status)

Set the event status.

image(string|array $image)

Set the event images.

location(SchemaObject|string $location)

Set the event location. A string is treated as the name of a physical place.

name(string $name)

Set the event name.

offers(Offer|array $offers)

Set the event offers.

organizer(Organization|Person $organizer)

Set the event organizer.

performer(Organization|Person|array $performer)

Set the event performers.

startDate(DateTimeInterface|string $startDate)

Set the event start date.

Details

in SchemaObject at line 31
__construct(string|null $type = null)

Create a schema with an explicit or inferred type.

Parameters

string|null $type

in SchemaObject at line 39
SchemaObject set(string $property, mixed $value)

Set a schema property, coercing nested schema objects and dates.

Parameters

string $property
mixed $value

Return Value

SchemaObject

in SchemaObject at line 49
SchemaObject date(string $property, DateTimeInterface|string $date)

Set a date property using an ISO 8601 value.

Parameters

string $property
DateTimeInterface|string $date

Return Value

SchemaObject

in SchemaObject at line 59
array toArray()

Get the schema type and properties.

Return Value

array

in SchemaObject at line 69
array toJsonLd()

Get the schema with its JSON-LD context.

Return Value

array

in SchemaObject at line 79
array jsonSerialize()

Get the schema's JSON representation.

Return Value

array

in SchemaObject at line 89
SchemaObject __call(string $method, array $parameters)

Dynamically set the schema property named by the called method.

Parameters

string $method
array $parameters

Return Value

SchemaObject

in SchemaObject at line 105
protected mixed coerce(mixed $value)

Normalize nested schemas and dates into their serialized values.

Parameters

mixed $value

Return Value

mixed

in SchemaObject at line 125
protected string typeFromAttribute()

Resolve the schema.org type from the SchemaType attribute or the class name.

Return Value

string

in SchemaObject at line 142
static void flushState()

Flush all static state.

Return Value

void

at line 18
Event description(string $description)

Set the event description.

Parameters

string $description

Return Value

Event

at line 26
Event doorTime(DateTimeInterface|string $doorTime)

Set the time admission begins.

Parameters

DateTimeInterface|string $doorTime

Return Value

Event

at line 34
Event endDate(DateTimeInterface|string $endDate)

Set the event end date.

Parameters

DateTimeInterface|string $endDate

Return Value

Event

at line 42
Event eventAttendanceMode(EventAttendanceMode $mode)

Set the event attendance mode.

Parameters

EventAttendanceMode $mode

Return Value

Event

at line 50
Event eventStatus(EventStatus $status)

Set the event status.

Parameters

EventStatus $status

Return Value

Event

at line 60
Event image(string|array $image)

Set the event images.

Parameters

string|array $image

Return Value

Event

at line 68
Event location(SchemaObject|string $location)

Set the event location. A string is treated as the name of a physical place.

Parameters

SchemaObject|string $location

Return Value

Event

at line 76
Event name(string $name)

Set the event name.

Parameters

string $name

Return Value

Event

at line 86
Event offers(Offer|array $offers)

Set the event offers.

Parameters

Offer|array $offers

Return Value

Event

at line 94
Event organizer(Organization|Person $organizer)

Set the event organizer.

Parameters

Organization|Person $organizer

Return Value

Event

at line 104
Event performer(Organization|Person|array $performer)

Set the event performers.

Parameters

Organization|Person|array $performer

Return Value

Event

at line 112
Event startDate(DateTimeInterface|string $startDate)

Set the event start date.

Parameters

DateTimeInterface|string $startDate

Return Value

Event