Place extends Site uses SetAdditionalPropertyTrait, SetContactPointTrait, SetGeoCoordinatesTrait, SetPostalAddressTrait
The house Place representation : a location described by a flat dataset row.
Where Place mirrors Schema.org, this one adds the ingestion behavior the back office needs — the same set SiteTrait groups for the site flavours, composed here directly. A flat row can therefore be assigned property by property, without the caller mapping anything by hand : see Place::__set() for what is routed where.
Note the hierarchy, which reads the other way round from what the names suggest :
this class extends Site, which extends the Schema.org Place. Site is
where the shared members live — contactPoint, deliveryMethod, ownedBy,
position — so Place sits alongside Office, Warehouse, JobSite,
CustomerSite and ProviderSite rather than above them.
Tags
Table of Contents
Constants
- CONTEXT : string = \xyz\oihana\schema\constants\Oihana::SCHEMA
- The @context of the json-ld representation of the thing.
- JSON_PRIORITY_KEYS : array<string|int, mixed> = [\org\schema\constants\Schema::AT_TYPE, \org\sc...
- Defines the priority order of keys when serializing the object to JSON-LD.
Properties
- $_from : string|null
- The metadata to indicates the edge 'from' identifier.
- $_id : null|string
- The metadata identifier of the item.
- $_key : null|string
- The metadata unique key identifier of the thing.
- $_rev : null|string
- The metadata revision value of the thing.
- $_to : string|null
- The metadata to indicates the edge 'to' identifier.
- $active : bool|null
- The visibility flag.
- $additional : object|array<string|int, mixed>|string|null
- The additional description of the place.
- $additionalProperty : null|array<string|int, mixed>|PropertyValue
- A property-value pair representing an additional characteristic of the entity, e.g. a product feature or another characteristic for which there is no matching property in schema.org.
- $additionalType : array<string|int, mixed>|string|null|object
- An additionalType for the item.
- $address : PostalAddress|string|array<string|int, PostalAddress|string>|null
- Physical address of the item (PostalAddress or any object to describe it).
- $aggregateRating : array<string|int, mixed>|AggregateRating|null
- The overall rating, based on a collection of reviews or ratings, of the item.
- $alternateName : string|object|array<string|int, mixed>|null
- An alias for the item.
- $amenityFeature : array<string|int, mixed>|LocationFeatureSpecification|null
- An amenity feature (e.g. a characteristic or service) of the Accommodation.
- $branchCode : string|null
- A short textual code (also called "store code") that uniquely identifies a place of business.
- $contactPoint : null|ContactPoint|array<string|int, mixed>|string
- A contact point for a person or organization.
- $containedInPlace : array<string|int, mixed>|Place|null
- The basic containment relation between a place and another that it contains.
- $containsPlace : array<string|int, mixed>|Place|null
- The basic containment relation between a place and another that it contains.
- $created : null|string
- Date of creation of the resource.
- $deliveryMethod : null|array<string|int, mixed>|string|DeliveryMethod|DefinedTerm
- The standardized procedure used to transfer a product or service to its destination.
- $description : string|object|array<string|int, mixed>|null
- A short description of the item.
- $disambiguatingDescription : string|null
- A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
- $email : null|string|PropertyValue|array<string|int, PropertyValue|string>
- The Email address.
- $event : null|Event|array<string|int, Event>
- Upcoming or past events associated with this place or organization (legacy spelling; see singular form, event).
- $faxNumber : string|null|array<string|int, PropertyValue|string>|PropertyValue
- The fax number.
- $geo : null|array<string|int, mixed>|GeoCoordinates|GeoShape
- The geo coordinates of the place (GeoShape or GeoCoordinates).
- $hasCertification : array<string|int, mixed>|Certification|null
- Certification information about a product, organization, service, place, or person.
- $hasDriveThroughService : bool|null
- Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.
- $hasGS1DigitalLink : string|null
- The GS1 digital link associated with the object.
- $hasMap : string|Map|null
- A URL to a map of the place.
- $hasPart : string|Thing|array<string|int, Thing>|null
- Indicates an item that this part of this item.
- $id : null|int|string
- The unique identifier of the item.
- $identifier : string|null
- The identifier of the item.
- $image : string|ImageObject|array<string|int, ImageObject|string>|null
- The image reference of this resource.
- $images : array<string|int, mixed>|null
- Photographs of this place (legacy spelling; see singular form, photo).
- $isAccessibleForFree : bool|null
- A flag to signal that the item, event, or place is accessible for free.
- $isicV4 : string|null
- The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
- $isPartOf : string|Thing|array<string|int, Thing>|null
- Indicates an item that this item is part of.
- $keywords : string|DefinedTerm|array<string|int, mixed>|null
- Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
- $latitude : null|int|float
- The latitude of a location. For example 37.42242 (WGS 84).
- $license : string|object|null
- A legal document giving official permission to do something with the resource.
- $logo : null|string|ImageObject
- An associated logo.
- $longitude : null|int|float
- The longitude of a location. For example -122.08585 (WGS 84).
- $mainEntityOfPage : string|null
- Indicates a page (or other CreativeWork) for which this thing is the main entity being described.
- $maximumAttendeeCapacity : null|int|string
- The total number of individuals that may attend an event or venue.
- $modified : null|string
- Date on which the resource was changed.
- $name : int|string|null
- The name of the item.
- $offers : array<string|int, mixed>|Offer|null|Demand
- An offer to provide this item.
- $openingHoursSpecification : null|array<string|int, mixed>|OpeningHoursSpecification
- The opening hours of a certain place.
- $ownedBy : int|array<string|int, mixed>|string|Organization|Person|null
- The organization or person that owns or operates this site.
- $owner : null|string|Thing
- The owner of this Thing.
- $photo : null|array<string|int, mixed>|ImageObject|Photograph
- Photographs of this place (legacy spelling; see singular form, photo).
- $position : int|string|null
- The position of this site within a sequence or ordered collection of related sites.
- $potentialAction : array<string|int, mixed>|Action|null
- Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
- $publicAccess : bool|null
- A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value.
- $publisher : string|array<string|int, string|Person|Organization>|Person|Organization|null
- The publisher of the resource.
- $remainingAttendee : int|null
- The number of the remaining attendee.
- $review : array<string|int, mixed>|Review|null
- A review of the item.
- $sameAs : string|array<string|int, mixed>|null
- URL of a reference Web page that unambiguously indicates the item's identity.
- $service : null|array<string|int, mixed>|Service
- The services provided by a place.
- $slogan : string|object|null
- A slogan or motto associated with the item.
- $smokingAllowed : bool|null
- Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.
- $specialOpeningHoursSpecification : null|array<string|int, OpeningHoursSpecification>|OpeningHoursSpecification
- The special opening hours of a certain place.
- $subjectOf : null|string|array<string|int, mixed>|CreativeWork|Event
- A CreativeWork or Event about this Thing.
- $telephone : string|null|array<string|int, mixed>|PropertyValue
- The telephone number.
- $tourBookingPage : null|string|Thing
- A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.
- $url : int|string|null
- URL of the item.
- $website : array<string|int, mixed>|null|string|WebSite
- The collection of all websites of this place.
- $atContext : string|null
- The JSON-LD `@context` value.
- $atType : string|null
- The JSON-LD `@type` value.
- $DEFAULT_JSON_SERIALIZE_OPTIONS : array<string|int, mixed>
- The default static jsonSerialize options (class-level configuration).
- $schemaTypeCache : array<string, string>
- Internal cache for resolved schema types.
Methods
- __construct() : mixed
- Constructor to hydrate public properties from an array or stdClass.
- __set() : void
- Routes an unknown property expression to the handler that knows it.
- getJsonSerializeOptions() : array<string|int, mixed>
- Returns the default JSON serialization options.
- getSchemaType() : string
- Returns the fully qualified URI of the schema type.
- jsonSerialize() : array<string|int, mixed>
- Serializes the current object into a JSON-LD array.
- normalizePostalAddress() : mixed
- Normalize a PostalAddress definition and search if the streetAddress expression contains a ';' separator to extract properties from the specific field.
- setAdditionalProperties() : bool
- Set a new optional additional properties of the place.
- setGeoCoordinatesProperties() : bool
- Set the GeoCoordinates properties.
- setGeoCoordinatesProperty() : bool
- Internal method to inject custom properties in the PostalAddress property of the place.
- setPostalAddressProperties() : bool
- Set the PostalAddress properties.
- setPostalAddressProperty() : bool
- Internal method to inject custom properties in the PostalAddress property of the place.
- withAtContext() : $this
- Sets the internal JSON-LD `@context` attribute.
- withAtType() : $this
- Sets the internal JSON-LD `@type` attribute.
- withJSONLDMeta() : $this
- Initializes both JSON-LD metadata: `@type` and `@context`.
- contactPointList() : array<string|int, mixed>
- The contact points as a list, whatever shape the property holds.
- findContactPointByType() : ContactPoint|null
- Find a specific ContactPoint reference by type.
- isValidPhoneNumber() : bool
- Validate a phone number expression (basic check, any country).
- setAdditionalProperty() : void
- Internal method to inject custom properties in the PostalAddress property of the place.
- setContactPointProperty() : bool
- Internal method to inject custom properties in the PostalAddress property of the place.
Constants
CONTEXT
The @context of the json-ld representation of the thing.
public
string
CONTEXT
= \xyz\oihana\schema\constants\Oihana::SCHEMA
JSON_PRIORITY_KEYS
Defines the priority order of keys when serializing the object to JSON-LD.
public
array<string|int, mixed>
JSON_PRIORITY_KEYS
= [\org\schema\constants\Schema::AT_TYPE, \org\schema\constants\Schema::AT_CONTEXT, \org\schema\constants\Schema::_KEY, \org\schema\constants\Schema::_FROM, \org\schema\constants\Schema::_TO, \org\schema\constants\Schema::ID, \org\schema\constants\Schema::NAME, \org\schema\constants\Schema::URL, \org\schema\constants\Schema::CREATED, \org\schema\constants\Schema::MODIFIED]
Keys listed here will always appear first in the serialized array, in the order specified. All remaining public properties will be sorted alphabetically after these priority keys.
This ensures that important JSON-LD metadata and system fields
(like @type, @context, _key, id, url, created, modified, etc.)
appear at the top of the output for consistency and readability.
Usage:
$orderedKeys = self::JSON_PRIORITY_KEYS;
Notes:
- Can be overridden in a subclass by redefining the constant.
- Late static binding (
static::JSON_PRIORITY_KEYS) allows child classes to modify the serialization order.
List of JSON-LD keys in priority order.
Properties
$_from
The metadata to indicates the edge 'from' identifier.
public
string|null
$_from
$_id
The metadata identifier of the item.
public
null|string
$_id
$_key
The metadata unique key identifier of the thing.
public
null|string
$_key
$_rev
The metadata revision value of the thing.
public
null|string
$_rev
$_to
The metadata to indicates the edge 'to' identifier.
public
string|null
$_to
$active
The visibility flag.
public
bool|null
$active
$additional
The additional description of the place.
public
object|array<string|int, mixed>|string|null
$additional
Note : this property is a custom attribute of the original Place class defined in http://schema.org/Place.
$additionalProperty
A property-value pair representing an additional characteristic of the entity, e.g. a product feature or another characteristic for which there is no matching property in schema.org.
public
null|array<string|int, mixed>|PropertyValue
$additionalProperty
= null
Attributes
- #[HydrateWith]
- \org\schema\PropertyValue::class
$additionalType
An additionalType for the item.
public
array<string|int, mixed>|string|null|object
$additionalType
$address
Physical address of the item (PostalAddress or any object to describe it).
public
PostalAddress|string|array<string|int, PostalAddress|string>|null
$address
= null
$aggregateRating
The overall rating, based on a collection of reviews or ratings, of the item.
public
array<string|int, mixed>|AggregateRating|null
$aggregateRating
Attributes
- #[HydrateWith]
- \org\schema\AggregateRating::class
$alternateName
An alias for the item.
public
string|object|array<string|int, mixed>|null
$alternateName
$amenityFeature
An amenity feature (e.g. a characteristic or service) of the Accommodation.
public
array<string|int, mixed>|LocationFeatureSpecification|null
$amenityFeature
This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.
Attributes
- #[HydrateWith]
- \org\schema\LocationFeatureSpecification::class
$branchCode
A short textual code (also called "store code") that uniquely identifies a place of business.
public
string|null
$branchCode
The code is typically assigned by the parentOrganization and used in structured URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.
$contactPoint
A contact point for a person or organization.
public
null|ContactPoint|array<string|int, mixed>|string
$contactPoint
Declared here rather than on the leaf classes because every site flavour composes SetContactPointTrait — through SiteTrait or directly — and that trait reads and writes this property.
Tags
$containedInPlace
The basic containment relation between a place and another that it contains.
public
array<string|int, mixed>|Place|null
$containedInPlace
$containsPlace
The basic containment relation between a place and another that it contains.
public
array<string|int, mixed>|Place|null
$containsPlace
$created
Date of creation of the resource.
public
null|string
$created
$deliveryMethod
The standardized procedure used to transfer a product or service to its destination.
public
null|array<string|int, mixed>|string|DeliveryMethod|DefinedTerm
$deliveryMethod
This property may be expressed as a predefined DeliveryMethod, a DefinedTerm, a string identifier, or a list of such values.
$description
A short description of the item.
public
string|object|array<string|int, mixed>|null
$description
$disambiguatingDescription
A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
public
string|null
$disambiguatingDescription
The Email address.
public
null|string|PropertyValue|array<string|int, PropertyValue|string>
$email
$event
Upcoming or past events associated with this place or organization (legacy spelling; see singular form, event).
public
null|Event|array<string|int, Event>
$event
$faxNumber
The fax number.
public
string|null|array<string|int, PropertyValue|string>|PropertyValue
$faxNumber
$geo
The geo coordinates of the place (GeoShape or GeoCoordinates).
public
null|array<string|int, mixed>|GeoCoordinates|GeoShape
$geo
$hasCertification
Certification information about a product, organization, service, place, or person.
public
array<string|int, mixed>|Certification|null
$hasCertification
Attributes
- #[HydrateWith]
- \org\schema\creativeWork\Certification::class
$hasDriveThroughService
Indicates whether some facility (e.g. FoodEstablishment, CovidTestingFacility) offers a service that can be used by driving through in a car. In the case of CovidTestingFacility such facilities could potentially help with social distancing from other potentially-infected users.
public
bool|null
$hasDriveThroughService
$hasGS1DigitalLink
The GS1 digital link associated with the object.
public
string|null
$hasGS1DigitalLink
This URL should conform to the particular requirements of digital links.
The link should only contain the Application Identifiers (AIs) that are relevant for the entity being annotated,
for instance a Product or an Organization, and for the correct granularity. In particular, for products:
- A Digital Link that contains a serial number (AI 21) should only be present on instances of IndividualProduct
- A Digital Link that contains a lot number (AI 10) should be annotated as SomeProduct if only products from that lot are sold, or IndividualProduct if there is only a specific product.
- A Digital Link that contains a global model number (AI 8013) should be attached to a Product or a ProductModel.
Other item types should be adapted similarly.
Tags
$hasMap
A URL to a map of the place.
public
string|Map|null
$hasMap
$hasPart
Indicates an item that this part of this item.
public
string|Thing|array<string|int, Thing>|null
$hasPart
$id
The unique identifier of the item.
public
null|int|string
$id
$identifier
The identifier of the item.
public
string|null
$identifier
$image
The image reference of this resource.
public
string|ImageObject|array<string|int, ImageObject|string>|null
$image
$images
Photographs of this place (legacy spelling; see singular form, photo).
public
array<string|int, mixed>|null
$images
$isAccessibleForFree
A flag to signal that the item, event, or place is accessible for free.
public
bool|null
$isAccessibleForFree
$isicV4
The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
public
string|null
$isicV4
$isPartOf
Indicates an item that this item is part of.
public
string|Thing|array<string|int, Thing>|null
$isPartOf
$keywords
Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
public
string|DefinedTerm|array<string|int, mixed>|null
$keywords
$latitude
The latitude of a location. For example 37.42242 (WGS 84).
public
null|int|float
$latitude
Tags
$license
A legal document giving official permission to do something with the resource.
public
string|object|null
$license
$logo
An associated logo.
public
null|string|ImageObject
$logo
$longitude
The longitude of a location. For example -122.08585 (WGS 84).
public
null|int|float
$longitude
Tags
$mainEntityOfPage
Indicates a page (or other CreativeWork) for which this thing is the main entity being described.
public
string|null
$mainEntityOfPage
$maximumAttendeeCapacity
The total number of individuals that may attend an event or venue.
public
null|int|string
$maximumAttendeeCapacity
Supersedes capacity
$modified
Date on which the resource was changed.
public
null|string
$modified
$name
The name of the item.
public
int|string|null
$name
$offers
An offer to provide this item.
public
array<string|int, mixed>|Offer|null|Demand
$offers
$openingHoursSpecification
The opening hours of a certain place.
public
null|array<string|int, mixed>|OpeningHoursSpecification
$openingHoursSpecification
Attributes
- #[HydrateWith]
- \org\schema\OpeningHoursSpecification::class
$ownedBy
The organization or person that owns or operates this site.
public
int|array<string|int, mixed>|string|Organization|Person|null
$ownedBy
This typically represents the legal or operational owner of the location.
Attributes
- #[HydrateWith]
- \org\schema\Organization::class
- \org\schema\Person::class
$owner
The owner of this Thing.
public
null|string|Thing
$owner
Represents any entity (person, organization, system, or other object) that can be considered the possessor of this Thing.
$photo
Photographs of this place (legacy spelling; see singular form, photo).
public
null|array<string|int, mixed>|ImageObject|Photograph
$photo
A photograph of this place.
$position
The position of this site within a sequence or ordered collection of related sites.
public
int|string|null
$position
This can be used, for example, to express priority, display order, or hierarchical positioning.
$potentialAction
Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
public
array<string|int, mixed>|Action|null
$potentialAction
$publicAccess
A flag to signal that the Place is open to public visitors. If this property is omitted there is no assumed default boolean value.
public
bool|null
$publicAccess
$publisher
The publisher of the resource.
public
string|array<string|int, string|Person|Organization>|Person|Organization|null
$publisher
$remainingAttendee
The number of the remaining attendee.
public
int|null
$remainingAttendee
$review
A review of the item.
public
array<string|int, mixed>|Review|null
$review
Attributes
- #[HydrateWith]
- \org\schema\Review::class
$sameAs
URL of a reference Web page that unambiguously indicates the item's identity.
public
string|array<string|int, mixed>|null
$sameAs
E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
$service
The services provided by a place.
public
null|array<string|int, mixed>|Service
$service
$slogan
A slogan or motto associated with the item.
public
string|object|null
$slogan
$smokingAllowed
Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.
public
bool|null
$smokingAllowed
$specialOpeningHoursSpecification
The special opening hours of a certain place.
public
null|array<string|int, OpeningHoursSpecification>|OpeningHoursSpecification
$specialOpeningHoursSpecification
Attributes
- #[HydrateWith]
- \org\schema\OpeningHoursSpecification::class
$subjectOf
A CreativeWork or Event about this Thing.
public
null|string|array<string|int, mixed>|CreativeWork|Event
$subjectOf
$telephone
The telephone number.
public
string|null|array<string|int, mixed>|PropertyValue
$telephone
$tourBookingPage
A page providing information on how to book a tour of some Place, such as an Accommodation or ApartmentComplex in a real estate setting, as well as other kinds of tours as appropriate.
public
null|string|Thing
$tourBookingPage
$url
URL of the item.
public
int|string|null
$url
$website
The collection of all websites of this place.
public
array<string|int, mixed>|null|string|WebSite
$website
$atContext
The JSON-LD `@context` value.
protected
string|null
$atContext
= null
Default is https://schema.org.
$atType
The JSON-LD `@type` value.
protected
string|null
$atType
= null
This can be manually set or automatically inferred from the class name.
$DEFAULT_JSON_SERIALIZE_OPTIONS
The default static jsonSerialize options (class-level configuration).
protected
static array<string|int, mixed>
$DEFAULT_JSON_SERIALIZE_OPTIONS
= []
$schemaTypeCache
Internal cache for resolved schema types.
private
static array<string, string>
$schemaTypeCache
= []
Methods
__construct()
Constructor to hydrate public properties from an array or stdClass.
public
__construct([array<string|int, mixed>|object|null $init = null ]) : mixed
This allows objects to be quickly populated with associative data without manually setting each property.
Parameters
- $init : array<string|int, mixed>|object|null = null
-
A data array or object used to initialize the instance. Keys must match public property names.
Tags
__set()
Routes an unknown property expression to the handler that knows it.
public
__set(string $property, mixed $value) : void
The handlers are tried in order and the first one to claim the expression
wins : Place::setAdditionalProperties() for the flags and extras
listed by SiteAdditionalProperty, then
SetGeoCoordinatesTrait::setGeoCoordinatesProperties() for
geoLatitude, geoLongitude, geoDistance and geoElevation, then
SetPostalAddressTrait::setPostalAddressProperties() for the address
fields. An expression no handler claims is silently dropped — this hook
only ever fires for properties the class does not declare, so there is
nowhere to put it.
Contact points are the deliberate gap : SetContactPointTrait is
composed, but setContactPointProperty() is not part of this chain, so
mobile, default_email and their siblings are not ingested here. They
are on Company and
Person, which do call it.
Parameters
- $property : string
-
Property name.
- $value : mixed
-
Value of the property.
Tags
getJsonSerializeOptions()
Returns the default JSON serialization options.
public
getJsonSerializeOptions() : array<string|int, mixed>
This method determines how the jsonSerialize() output is reduced or compressed, etc.
It can be overridden in child classes to customize serialization behavior.
Return values
array<string|int, mixed> —Returns the reduction/compression options for JSON serialization.
getSchemaType()
Returns the fully qualified URI of the schema type.
public
static getSchemaType() : string
This method combines the class's CONTEXT constant with its short name
to produce a globally unique identifier for the entity type.
- It uses Late Static Binding to ensure the correct context is retrieved even when called from an inherited class (e.g., Corporation vs. Affiliate).
- Performance Optimization:
Results are stored in a static cache (
$schemaTypeCache) to avoid redundant Reflection calls during the same execution lifecycle.
Return values
string —The absolute URI of the type (e.g., "https://schema.org/Thing"). ** @example
echo Thing::getSchemaType(); // https://schema.org/Thing
echo Affiliate::getSchemaType(); // https://schema.oihana.xyz/Pagination
jsonSerialize()
Serializes the current object into a JSON-LD array.
public
jsonSerialize() : array<string|int, mixed>
Includes public properties, the JSON-LD @context and @type.
Null values are automatically removed.
Tags
Return values
array<string|int, mixed> —JSON-LD representation of the object.
normalizePostalAddress()
Normalize a PostalAddress definition and search if the streetAddress expression contains a ';' separator to extract properties from the specific field.
public
static normalizePostalAddress(mixed $definition[, string $separator = ';' ]) : mixed
Parameters
- $definition : mixed
-
The definition to normalize.
- $separator : string = ';'
-
The separator to explode the postal address expression (default ';'). An empty separator splits nothing and leaves the definition untouched —
explode()would raise aValueErroron it.
setAdditionalProperties()
Set a new optional additional properties of the place.
public
setAdditionalProperties(string $property, mixed $value) : bool
Parameters
- $property : string
-
Property name.
- $value : mixed
-
Value of the property.
Tags
Return values
bool —True if the property was handled, false otherwise
setGeoCoordinatesProperties()
Set the GeoCoordinates properties.
public
setGeoCoordinatesProperties(string $property, mixed $value) : bool
Parameters
- $property : string
-
The property to inject.
- $value : mixed
-
The value of the property.
Return values
boolsetGeoCoordinatesProperty()
Internal method to inject custom properties in the PostalAddress property of the place.
public
setGeoCoordinatesProperty(string $name, mixed $value) : bool
Parameters
- $name : string
-
The name of the property to transform.
- $value : mixed
-
The value of the property.
Return values
boolsetPostalAddressProperties()
Set the PostalAddress properties.
public
setPostalAddressProperties(string $property, mixed $value) : bool
Parameters
- $property : string
- $value : mixed
Return values
boolsetPostalAddressProperty()
Internal method to inject custom properties in the PostalAddress property of the place.
public
setPostalAddressProperty(string $name, mixed $value) : bool
Parameters
- $name : string
- $value : mixed
Return values
boolwithAtContext()
Sets the internal JSON-LD `@context` attribute.
public
withAtContext(string $context) : $this
Useful if you need a custom JSON-LD context.
Parameters
- $context : string
-
Optional JSON-LD context.
Return values
$thiswithAtType()
Sets the internal JSON-LD `@type` attribute.
public
withAtType(string $type) : $this
Allows overriding the default type inferred from the class.
Parameters
- $type : string
-
Optional JSON-LD type
Return values
$thiswithJSONLDMeta()
Initializes both JSON-LD metadata: `@type` and `@context`.
public
withJSONLDMeta([string|null $atType = null ][, string|null $atContext = null ]) : $this
Can be called from constructor or later to override default values.
Parameters
- $atType : string|null = null
-
Optional JSON-LD type
- $atContext : string|null = null
-
Optional JSON-LD context
Return values
$thiscontactPointList()
The contact points as a list, whatever shape the property holds.
protected
contactPointList() : array<string|int, mixed>
contactPoint is declared as null|ContactPoint|array|string wherever
this trait is composed, but the code around it only ever makes sense on a
list. A lone ContactPoint and an unresolved string reference are
therefore wrapped rather than discarded — nothing is lost, and the caller
can iterate and append without checking first.
Return values
array<string|int, mixed> —The contact points, always a list.
findContactPointByType()
Find a specific ContactPoint reference by type.
protected
findContactPointByType(string|null $type) : ContactPoint|null
Entries that are not hydrated ContactPoint instances — the raw arrays a base read hands back, or an unresolved reference — are skipped rather than dereferenced, so only a real instance is ever returned.
Parameters
- $type : string|null
-
The type of the resource to find.
Return values
ContactPoint|nullisValidPhoneNumber()
Validate a phone number expression (basic check, any country).
protected
isValidPhoneNumber(string $phone[, string|null $defaultRegion = 'FR' ]) : bool
Parameters
- $phone : string
-
The phone number to validate.
- $defaultRegion : string|null = 'FR'
-
region that we are expecting the number to be from. This is only used if the number being parsed is not written in international format. The country_code for the number in this case would be stored as that of the default region supplied. If the number is guaranteed to start with a '+' followed by the country calling code, then "ZZ" or null can be supplied.
Return values
bool —True if valid, false otherwise.
setAdditionalProperty()
Internal method to inject custom properties in the PostalAddress property of the place.
protected
setAdditionalProperty(array<string|int, mixed> $init) : void
Parameters
- $init : array<string|int, mixed>
Tags
setContactPointProperty()
Internal method to inject custom properties in the PostalAddress property of the place.
protected
setContactPointProperty(string $name, mixed $value) : bool
Parameters
- $name : string
-
The name of the property to transform.
- $value : mixed
-
The value of the property.