GenericSchemaObject
class GenericSchemaObject 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
Create a schema with an explicit or inferred type.
Set a schema property, coercing nested schema objects and dates.
Dynamically set the schema property named by the called method.
Normalize nested schemas and dates into their serialized values.
Resolve the schema.org type from the SchemaType attribute or the class name.
Details
in
SchemaObject at line 31
__construct(string|null $type = null)
Create a schema with an explicit or inferred type.
in
SchemaObject at line 39
SchemaObject
set(string $property, mixed $value)
Set a schema property, coercing nested schema objects and dates.
in
SchemaObject at line 49
SchemaObject
date(string $property, DateTimeInterface|string $date)
Set a date property using an ISO 8601 value.
in
SchemaObject at line 59
array
toArray()
Get the schema type and properties.
in
SchemaObject at line 69
array
toJsonLd()
Get the schema with its JSON-LD context.
in
SchemaObject at line 79
array
jsonSerialize()
Get the schema's JSON representation.
in
SchemaObject at line 89
SchemaObject
__call(string $method, array $parameters)
Dynamically set the schema property named by the called method.
in
SchemaObject at line 105
protected mixed
coerce(mixed $value)
Normalize nested schemas and dates into their serialized values.
in
SchemaObject at line 125
protected string
typeFromAttribute()
Resolve the schema.org type from the SchemaType attribute or the class name.
in
SchemaObject at line 142
static void
flushState()
Flush all static state.