2017 © Pedro Peláez
 

library hydrator

Object hydrator

image

zelenin/hydrator

Object hydrator

  • Thursday, June 22, 2017
  • by zelenin
  • Repository
  • 2 Watchers
  • 1 Stars
  • 67 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 10 % Grown

The README.md

Hydrator Build Status Coverage Status

Installation

Composer

The preferred way to install this extension is through Composer., (*1)

Either run, (*2)

php composer.phar require zelenin/hydrator "~0.0.1"

or add, (*3)

"zelenin/hydrator": "~0.0.1"

to the require section of your composer.json, (*4)

Usage

Example

$entity = new Entity(5, 'Title');

$hydrator = new StrategyHydrator(new ReflectionStrategy(), new RawNamingStrategy());

$data = $hydrator->extract($entity);
// $data = ['id' => 5, 'name' => 'Title']

$data = ['id' => 10, 'name' => 'New title'];

$newEntity = $hydrator->hydrate($entity, $data);
// $newEntity->getId() = 10, $newEntity->getName() = 'New title'

Author

Aleksandr Zelenin, e-mail: aleksandr@zelenin.me, (*5)

The Versions

22/06 2017

0.0.2

0.0.2.0 https://github.com/zelenin/hydrator

Object hydrator

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

extractor hydrator object hydration

08/06 2017

dev-master

9999999-dev https://github.com/zelenin/hydrator

Object hydrator

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

extractor hydrator object hydration

08/06 2017

0.0.1

0.0.1.0 https://github.com/zelenin/hydrator

Object hydrator

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

extractor hydrator object hydration