hydrateCustomerSite.php
Table of Contents
Functions
- hydrateCustomerSite() : mixed
- Hydrate an array definition with the CustomerSite class.
Functions
hydrateCustomerSite()
Hydrate an array definition with the CustomerSite class.
hydrateCustomerSite([mixed $init = null ]) : mixed
Handles both single CustomerSite array and array of CustomerSite things.
Each nested reference is hydrated only when the raw value is an array — when there is
something to hydrate. The helper's answer is then written as is, null included : an
array that resolves to nothing (an empty list, a list of unhydratable entries) becomes
null, never a leftover raw array, so the site answers the same thing as the nested
helper called on its own. Anything that is not an array — an unresolved string
reference, an already typed instance — is left untouched.
🔑 A bare reference survives inside a list, exactly as it does on its own : a list of unresolved handles comes back as it stands, and only an entry that was an array and resolved to nothing is dropped. The keys stay gap-free — a filtered list left with holes serializes as a JSON object, and a consumer walking the value gets something it cannot walk.
Parameters
- $init : mixed = null
-
Single CustomerSite data or array of CustomerSite data