. */ namespace SP\Domain\Common\Models; /** * Interface HydratableModel */ interface HydratableModel { /** * Deserialize the hydratable property and returns the object. * * @template T * @param class-string $class * * @return T|null */ public function hydrate(string $class): ?object; /** * Serialize the object in the hydratable property * @param object $object * * @return static A new instance of the model with the serialized property */ public function dehydrate(object $object): static; }