mvaliolahi/hydrate

There is no license information available for the latest version (v1.0.5) of this package.

PHP Hydrator Package.

v1.0.5 2023-03-01 14:15 UTC

This package is auto-updated.

Last update: 2024-04-29 16:47:30 UTC


README

Install

composer require mvaliolahi/hydrate

Example

$hydrate = new Hydrate();

/**
 * @var PostDTO
 */
$post = $hydrate->to(PostDTO::class, [
  'title' => 'Test',
  'description' =>  'sample post'
]);
  • Tip: third argument of to() method can be use to overwrite data.

todo

- cast some fields to specefic object after hydrate.
- add toArray method.