hydrateVisitReport.php
Table of Contents
Functions
- hydrateVisitReport() : mixed
- Hydrate an array definition with the VisitReport class.
Functions
hydrateVisitReport()
Hydrate an array definition with the VisitReport class.
hydrateVisitReport([mixed $init = null ][, DefinedTerm>|array<string, DefinedTerm>|array<string, DefinedTerm>>> $termClass = ThesaurusTerm::class ]) : mixed
Handles both a single report array and an array of reports.
🔑 What every report carries is resolved by hydrateMeetingReport() — the promises, the qualifiers, what was covered, who wrote it — and this helper asks it for a VisitReport rather than copying its body. What is left here is what only a visit carries :
attendee— the people actually met, as CustomerEmployee, one or several. The parent leaves the union wide on purpose : who sits at a table depends on the kind of meeting, and a visit is the family that knows ;moodandoutcome— one term each, how it felt and what it produced.
🔑 The vocabularies are read as the class their family serves, in the two forms termClassOf() reads — one class for every property, or a map naming them one by one :
hydrateVisitReport( $raw ) ; // the house term, everywhere
hydrateVisitReport( $raw , DefinedTerm::class ) ; // one named class, everywhere
hydrateVisitReport( $raw , [ Prop::DEFAULT => ThesaurusTerm::class , VisitReport::MOOD => MoodTerm::class ] ) ;
🔑 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 report data or array of report data.
- $termClass : DefinedTerm>|array<string, DefinedTerm>|array<string, DefinedTerm>>> = ThesaurusTerm::class
-
The class the term properties are hydrated into, or a map naming them one by one. A map may carry entries this helper does not read — a report hydrated from a meeting receives the meeting's map as it stands, branches included. See termClassOf().