mini\Database\Dehydrator final class

Documentation

Converts between entity objects and SQL-compatible arrays

Handles hydration/dehydration via:

  1. Hydratable interface - if entity implements Hydratable, uses fromSqlRow()
  2. Dehydratable interface - if entity implements Dehydratable, uses toSqlRow()
  3. Reflection fallback - maps properties to columns with type conversion

Used by PartialQuery for reading and by write operations for validation.

Properties (1)

private static array $hydrating

Track classes currently being hydrated to detect recursion

Methods (4)

Hydrate a database row to an entity instance

Hydrate using reflection (maps columns to properties with type conversion)

Dehydrate an entity to a SQL-compatible array

Dehydrate using reflection (reads public properties, converts values)

Source

src/Database/Dehydrator.php:20-195