2017 © Pedro Peláez
 

library hydrator

Hydrator

image

kwizer/hydrator

Hydrator

  • Monday, April 9, 2018
  • by kwizer15
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Hydrator

Build Status, (*1)

A simple hydrator without mapping., (*2)

Why

Hydrate an instance simply with a data source., (*3)

How

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)

Installation

composer require kwizer/hydrator

The Versions

09/04 2018

dev-master

9999999-dev

Hydrator

  Sources   Download

MIT

The Development Requires

09/04 2018

1.0.0

1.0.0.0

Hydrator

  Sources   Download

MIT

The Development Requires