Oihana PHP System

hydrateCustomerEmployee.php

Table of Contents

Functions

hydrateCustomerEmployee()  : mixed
Hydrate an array definition with the CustomerEmployee class.

Functions

hydrateCustomerEmployee()

Hydrate an array definition with the CustomerEmployee class.

hydrateCustomerEmployee([mixed $init = null ]) : mixed

Handles both single employee array and array of employees.

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 employee 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 employee data or array of employee data

Tags
throws
ReflectionException
On this page

Search results