zend-hydrator is part of zendframework and provides object hydrators and array extraction
Questions tagged [zend-hydrator]
10 questions
3
votes
1 answer
Creating complex models using hydrators: aggregate / strategies
I had previously built complex models (an object containing many other types of model) using a service layer with different mappers passed in as the constructor.
eg.
class UserService{
public function __construct(UserMapper $userMapper,…

John Crest
- 201
- 1
- 4
- 24
2
votes
1 answer
How to convert a PHP Object with private properties that are Objects into an array using Zend Hydrator?
Code
class Composite
{
private $a;
private $b;
/**
*
* @return the $a
*/
public function getA()
{
return $this->a;
}
/**
*
* @return the $b
*/
public function getB()
{
…

Dennis
- 7,907
- 11
- 65
- 115
1
vote
1 answer
ZF FactoryInterface - using options parameter for configuring loading dependencies
I am wondering about the best practices for loading complex objects.
To begin with, i'm going to outline some boilerplate before getting to the problem.
Assume the following: A simple domain model Client is loaded using a tablegateway, with…

John Crest
- 201
- 1
- 4
- 24
0
votes
1 answer
Why my Zend-HAL implementation is not working with protected values
I am new in Zend framework, and trying to use HAL for API response generation. In the following is a simpler situation of my issues.
The class:
class Version
{
protected $data;
public function __construct($ar){
$data = $ar;
}
…

Md Monjur Ul Hasan
- 1,705
- 1
- 13
- 36
0
votes
0 answers
Zend Framework 3 Hydrator
I have this code:
$settingsModel = new Settings();
$hydrator = new ReflectionHydrator();
$incomingData = array('[meta_title]' => 'CMS');
$datas = $hydrator->hydrate($incomingData, $settingsModel);
When i print $datas…

Kurczakovsky
- 75
- 1
- 8
0
votes
1 answer
Convert many dimensions array to object (but not to stdClass)
I have some project where I get from external API big dimension array. This api return JSON in many dimensions. I have to do many operations of this data so I want to change/convert this nested array to my object class, not StdObject.
I looking long…

Marcin
- 1
- 1
0
votes
0 answers
Hydrating and using ZF2 aggregate hydrator
Is using an aggregate hydrator appropriate for this situation? If so how would I go about hydrating these entities, I found the documentation confusing & can't really find any examples online.
I have two entities with a many-to-many relationship.…

mevans
- 196
- 2
- 9
0
votes
1 answer
Why is martyshka/ShoppingCart ZF2 component not working (hidrator issue maybe)?
I'm having a lot of headache trying to implement martyshka/ShoppingCart component. All I found was the hydrator was null while adding items, but it didn't work too when I forced it (setting it on the component).
Here's my controller

Salustiano Muniz
- 322
- 5
- 20
0
votes
1 answer
zf2 - Nested Aggregate Hydrators
Is it possible to nest aggregate hydrators? If i have the following classes:
class Appointment{
public date;
public startTime;
public endTime;
public User; //* @var User */
}
class User{
public Location; //* @var Location*/…

John Crest
- 201
- 1
- 4
- 24
0
votes
1 answer
ZendFramework 2 - removing InputFilter causes misbehavior in custom filter
I have an registration form User\UserForm which contains a fieldset User\UserFieldset. In User\UserFieldset I put an field called "passwordVerify" which should be identical with another field in the fieldset called "password".
This works…

koseduhemak
- 523
- 2
- 4
- 19