dev-master
9999999-devHydrator
MIT
The Development Requires
1.0.0
1.0.0.0Hydrator
MIT
The Development Requires
Hydrator
A simple hydrator without mapping., (*2)
Hydrate an instance simply with a data source., (*3)
Instantiate the hydrator and call the hydrate method with the object to hydrate and the data source, (*4)
class MyClass { private $foo; } $myDatas = ['foo' => 'bar']; $hydrator = new \Kwizer\Hydrator\Hydrator(); $myObject = $hydrator->hydrate(MyClass::class, $myDatas);
You can directly hydrate an object already instantiated., (*5)
$myObject = new MyClass(); $myObject = $hydrator->hydrate($myObject, $myDatas);
Or hydrate with an object source, (*6)
$datas = new \stdClass(); $datas->foo = 'bar'; $myObject = $hydrator->hydrate(MyClass::class, $myDatas);
The hyrator uses the with methods and set methods first if presents, then directly the property, breaking accessibility if necessary., (*7)
composer require kwizer/hydrator
Hydrator
MIT
Hydrator
MIT