Returns a dataset-definition-object.
This object contains all infos on a defined dataset.
Syntax
datasetDefinition(?string $datasetLabel): string
- $datasetLabel - string
The dataset-label for which to get its definition for.
Example
{# Get the definition-object for dataset "person": #} {% set dsDef = hublify.datasetDefinition("person") %} {# ... access here further details with: dsDef.<function>(...) #}
Functions
The created dataset-defintion-object provides following functions to easily access all further definition-details.
getFieldDefinition(...)
Returns the definition of a specific field of the dataset-definition.
getFieldDefinition(?string $field): ?array
getFieldI18nString(...)
Returns the i18n-string for a dataset's field.
It regards it explicitly set i18n-string for the field, or builds it from the dataset's i18n-prefix.
getFieldI18nString(?string $field, ?string $suffix = 'name'): ?string
getFields()
Returns an array of all field-labels of the dataset-definition.
getFields(): array
getIconLabel()
Returns the dataset's defined icon-label.
This is the label of the icon that is used to represent the dataset.
getIconLabel(): ?string
getIconUrl(...)
Returns the absolute url for the dataset's defined icon.
This is the label of the icon that is used to represent the dataset.
See main function appIconUrl() for more details.
getIconUrl(?string $weight = null): ?string
getPrimaryDisplayField()
Returns the field-label of the primary display field.
getPrimaryDisplayField(): ?string
getPrimaryField()
Returns the field-label of the primary field.
getPrimaryField(): ?string
translate(...)
translate(?string $suffix = 'name'): ?string
translateField(...)
translateField(?string $field, ?string $suffix = 'name'): ?string