A
A
Anykin2017-02-11 20:29:40
Zend Framework
Anykin, 2017-02-11 20:29:40

Why didn't AggregateHydrator stop working when migrating zf2->zf3?

Hello!
I can’t understand why the AggregateHydrator stopped working if it was received in the mapper factory using the factory.

$aggregatehydrator = $container->get(AggregateHydrator::class);

When trying to display $aggregatehydrator
\Zend\Debug\Debug::dump($aggregatehydrator);
php dies (memory limit).
If you do this in the mapper factory:
$tagsHydrator = $container->get(TagsHydrator::class);
        $categoryHydrator = $container->get(CategoryHydrator::class);
        $postHydrator = $container->get(PostHydrator::class);
        $datesHydrator = $container->get(DatesHydrator::class);
        $aggregatehydrator = new \Zend\Hydrator\Aggregate\AggregateHydrator();
        $aggregatehydrator->add($postHydrator);
        $aggregatehydrator->add($categoryHydrator);
        $aggregatehydrator->add($tagsHydrator);
        $aggregatehydrator->add($datesHydrator);

then everything works.
https://bitbucket.org/mad-max/blog-note3/overview

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anykin, 2017-03-03
@Anykin

Added to AggregateHydratorFactory:

$aggregatehydrator = new AggregateHydrator();
$aggregatehydrator->setEventManager($container->get('EventManager'));

https://github.com/zendframework/zend-hydrator/iss...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question