JsonLD
in package
uses
TraitData, TraitImageTools, TraitPartyInfo, TraitSeo
Table of Contents
Constants
- SCHEMA_URL = 'https://schema.org/'
Properties
- $cfgImgPath : array<string|int, mixed>
- $cflLngDef : array<string|int, mixed>
- $gbUrl : string
- $gbUrlImg : string
- $partyData : array<string|int, mixed>
- $env : array<string|int, mixed>
- $imageTools : ImageTools
- $input : Input
Methods
- __construct() : mixed
- getDataInstance() : Data
- getEvent() : string
- Generates a JSON-LD representation of an event, including detailed metadata about the event such as its name, start and end times, location, organizer, status, and attendance mode. The structured data follows the Schema.org guidelines for describing events and can include additional optional properties like previous start date when an event is rescheduled or offering details.
- getImageObj() : array<string|int, mixed>
- getImageToolsInstance() : ImageTools
- getPartyFlyer() : array<string|int, mixed>
- getPartyInfoInstance() : PartyInfo
- getPartyLinksList() : string
- Generates a JSON-LD representation of a list of party-related links.
- getSeoInstance() : Seo
- addKeywordsToJsonLD() : array<string|int, mixed>
- createWeatherJsonLD() : array<string|int, mixed>
- Generates a weather forecast array including various weather-related details.
- generateListItems() : array<string|int, mixed>
- generateOrganizationJsonLD() : array<string|int, mixed>
- getEventAttendanceMode() : string
- getEventStatus() : string
- getEventType() : string
- getGeoAndMapData() : array{'geo': array, 'hasMap': array}
- getImage() : array<string|int, mixed>
- getIso8601Duration() : string
- ISO 8601 duration
- getJsonLocal() : array<string|int, mixed>
- getOffer() : array<string|int, mixed>
- getOrgaData() : array<string|int, mixed>
- getPreviousStartDate() : array<string|int, mixed>
- hier kommt "previousStartDate": "2025-03-21T19:00-05:00",
- getSameAs() : array<string|int, mixed>|array<string|int, string>
- getWeatherForecast() : array<string|int, mixed>|null
- Retrieves the weather forecast for a specific location and date.
- sanitizePartyData() : void
- sanitizePartyField() : void
- serializeWeatherForecast() : array{'id': string, 'temperature': float|null, 'feelsLikeTemperature': float|null, 'windSpeed': float|null, 'relativeHumidity': float|null, 'weatherType': null|string, 'validFrom': string, 'validUntil': string}
- It's placed in the cached.
Constants
SCHEMA_URL
public
mixed
SCHEMA_URL
= 'https://schema.org/'
Properties
$cfgImgPath
public
array<string|int, mixed>
$cfgImgPath
$cflLngDef
public
array<string|int, mixed>
$cflLngDef
$gbUrl
public
string
$gbUrl
$gbUrlImg
public
string
$gbUrlImg
$partyData
public
array<string|int, mixed>
$partyData
$env
private
array<string|int, mixed>
$env
$imageTools
private
ImageTools
$imageTools
$input read-only
private
Input
$input
Methods
__construct()
public
__construct(Input $input[, array<string|int, mixed>|null $party = [] ]) : mixed
Parameters
- $input : Input
- $party : array<string|int, mixed>|null = []
getDataInstance()
public
getDataInstance() : Data
Return values
DatagetEvent()
Generates a JSON-LD representation of an event, including detailed metadata about the event such as its name, start and end times, location, organizer, status, and attendance mode. The structured data follows the Schema.org guidelines for describing events and can include additional optional properties like previous start date when an event is rescheduled or offering details.
public
getEvent() : string
Return values
string —JSON-LD structured data as a string. If the property bScript is set to true,
the JSON-LD is wrapped in a script tag with type "application/ld+json".
getImageObj()
public
getImageObj(array<string|int, mixed> $imgData, array<string|int, mixed> $imgSize) : array<string|int, mixed>
Parameters
- $imgData : array<string|int, mixed>
- $imgSize : array<string|int, mixed>
Return values
array<string|int, mixed>getImageToolsInstance()
public
getImageToolsInstance() : ImageTools
Return values
ImageToolsgetPartyFlyer()
public
getPartyFlyer() : array<string|int, mixed>
Return values
array<string|int, mixed>getPartyInfoInstance()
public
getPartyInfoInstance() : PartyInfo
Return values
PartyInfogetPartyLinksList()
Generates a JSON-LD representation of a list of party-related links.
public
getPartyLinksList() : string
The list includes links to different party resources, structured in the format of an ItemList with individual ListItem elements.
Return values
string —JSON-LD structured data as a string. If the property bScript is set to true,
the JSON-LD is wrapped in a script tag with type "application/ld+json".
getSeoInstance()
public
getSeoInstance() : Seo
Return values
SeoaddKeywordsToJsonLD()
private
addKeywordsToJsonLD(array<string|int, mixed> $jsonLD) : array<string|int, mixed>
Parameters
- $jsonLD : array<string|int, mixed>
Return values
array<string|int, mixed>createWeatherJsonLD()
Generates a weather forecast array including various weather-related details.
private
createWeatherJsonLD(array<string|int, mixed> $forecast) : array<string|int, mixed>
Parameters
- $forecast : array<string|int, mixed>
-
An aray containing weather data such as temperature, wind speed, and humidity.
Return values
array<string|int, mixed> —An associative array containing weather forecast information, including temperature, wind speed, humidity, and validity period.
generateListItems()
private
generateListItems(array<string|int, mixed> $saPartyShort) : array<string|int, mixed>
Parameters
- $saPartyShort : array<string|int, mixed>
Return values
array<string|int, mixed>generateOrganizationJsonLD()
private
generateOrganizationJsonLD(array<string|int, mixed> $saUserOrga) : array<string|int, mixed>
Parameters
- $saUserOrga : array<string|int, mixed>
Return values
array<string|int, mixed>getEventAttendanceMode()
private
getEventAttendanceMode() : string
Return values
stringgetEventStatus()
private
getEventStatus() : string
Return values
stringgetEventType()
private
getEventType() : string
Return values
stringgetGeoAndMapData()
private
getGeoAndMapData() : array{'geo': array, 'hasMap': array}
Return values
array{'geo': array, 'hasMap': array}getImage()
private
getImage(string $strFlyer) : array<string|int, mixed>
Parameters
- $strFlyer : string
Return values
array<string|int, mixed>getIso8601Duration()
ISO 8601 duration
private
getIso8601Duration() : string
Return values
stringgetJsonLocal()
private
getJsonLocal(array<string|int, mixed>|string $seoName) : array<string|int, mixed>
Parameters
- $seoName : array<string|int, mixed>|string
Return values
array<string|int, mixed>getOffer()
private
getOffer() : array<string|int, mixed>
Return values
array<string|int, mixed>getOrgaData()
private
getOrgaData() : array<string|int, mixed>
Return values
array<string|int, mixed>getPreviousStartDate()
hier kommt "previousStartDate": "2025-03-21T19:00-05:00",
private
getPreviousStartDate() : array<string|int, mixed>
Return values
array<string|int, mixed>getSameAs()
private
getSameAs(string $seoName) : array<string|int, mixed>|array<string|int, string>
Parameters
- $seoName : string
Return values
array<string|int, mixed>|array<string|int, string>getWeatherForecast()
Retrieves the weather forecast for a specific location and date.
private
getWeatherForecast() : array<string|int, mixed>|null
Attempts to fetch from cache; if not available, retrieves weather data via API and caches the result.
Return values
array<string|int, mixed>|null —The weather forecast data if successful, or null if data is unavailable or an error occurs.
sanitizePartyData()
private
sanitizePartyData() : void
sanitizePartyField()
private
sanitizePartyField([string $field = 'live' ]) : void
Parameters
- $field : string = 'live'
serializeWeatherForecast()
It's placed in the cached.
private
serializeWeatherForecast(Weather $weather, DateTime $date) : array{'id': string, 'temperature': float|null, 'feelsLikeTemperature': float|null, 'windSpeed': float|null, 'relativeHumidity': float|null, 'weatherType': null|string, 'validFrom': string, 'validUntil': string}
Parameters
- $weather : Weather
-
An object containing weather data such as temperature, wind speed, and humidity.
- $date : DateTime
-
The date and time for the forecast generation, used for timestamp formatting.
Return values
array{'id': string, 'temperature': float|null, 'feelsLikeTemperature': float|null, 'windSpeed': float|null, 'relativeHumidity': float|null, 'weatherType': null|string, 'validFrom': string, 'validUntil': string} —An associative array containing weather forecast information, including temperature, wind speed, humidity, and validity period.