hydrateFollowUp.php
Table of Contents
Functions
- hydrateFollowUp() : mixed
- Hydrate an array definition with the FollowUp class.
Functions
hydrateFollowUp()
Hydrate an array definition with the FollowUp class.
hydrateFollowUp([mixed $init = null ]) : mixed
Handles both a single follow-up array and an array of follow-ups — the second is the usual shape, a report commonly carrying « call them back » beside « send the quote ».
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 becomes null, never a leftover raw array. Anything
that is not an array — an unresolved string reference, an already typed instance — is
left untouched.
🚨 result is built flat, and deliberately so. It names the meeting booked to
honour the promise ; that meeting has a report, that report has follow-ups, and each of
those may name a meeting in turn. Going down through
hydrateAppointment() would follow that chain for as long as the data
holds, and only the data would stop it. What is named here is a reference — a
meeting to open, not a document to unfold — so it is typed one level and no further :
its own nested references stay raw, and a consumer that needs them asks for that
meeting on its own.
🔑 An empty list is kept as an empty list, where the rest of the family answers
null — the hydrateAdjustment()
rule. « This report has no follow-up » is an answer, and it is not the answer « nothing
here was readable » : a consumer mapping over the value deserves the empty list it can
map over. A non-empty list that hydrates to nothing keeps the family's null.
🔑 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 follow-up data or array of follow-up data.