Utility
class Utility (View source)
A class holding utility methods
Methods
Transforms a text (for example a node title) into a valid node name by removing invalid characters and transliterating special characters if possible.
Sorts the incoming $dimensionValues array to make sure that before hashing, the ordering is made deterministic.
Generate a stable identifier for auto-created child nodes
Details
static string
renderValidNodeName(string $name)
Transforms a text (for example a node title) into a valid node name by removing invalid characters and transliterating special characters if possible.
static string
sortDimensionValueArrayAndReturnDimensionsHash(array $dimensionValues)
Sorts the incoming $dimensionValues array to make sure that before hashing, the ordering is made deterministic.
Then, calculates and returns the dimensionsHash.
This method is public because it is used inside SiteImportService.
static string
buildAutoCreatedChildNodeIdentifier(string $childNodeName, string $identifier)
Generate a stable identifier for auto-created child nodes
This is needed if multiple node variants are created through "createNode" with different dimension values. If child nodes with the same path and different identifiers exist, bad things can happen.