zendframework/zf2 — pull request #6220 by ojhaujjwal (2014-05-05 04:57:21+00:00)
Title: Created JsonStrategy for hydrator

## Example:
```php
Class User
{
protected $roles = array();

public function setRoles(array $roles)
{
$this->roles = $roles;
}

public function getRoles()
{
return $this->roles;
}
}

$user = new User;

$hydrator = new Zend\Stdlib\Hydrator\ClassMethods;
$strategy = new Zend\Stdlib\Hydrator\Strategy\JsonStrategy();
$hydrator->addStrategy('roles', $strategy);
$hydrator->setObjectDecodeType(Zend\Json\Json::TYPE_ARRAY);
$hydrator->hydrate(array('roles' => array('ROLE_SUPER_ADMIN', 'ROLE_MANAGER')), $user);

print_r($user->getRoles());
// or
print_r($hydrator->extract($user)['roles']);
```

### Output:
`Array ( [0] => ROLE_SUPER_ADMIN [1] => ROLE_MANAGER )`