This library provides Doctrine Hydrators for Zend Framework application.
Run the following to install this library:
$ composer require webimpress/zend-doctrine-hydrator
You can use Zend\Doctrine\Hydrator\DoctrineObject
hydrator with your
zend-form
:
$hydrator = new DoctrineObject($objectManager, $byValue);
$myForm = new MyForm();
$myForm->setHydrator($hydrator);
To initialize DoctrineObject
hydrator you need to pass your ObjectManager
(EntityManager
) instance and flag, if hydrator should use entity's public
API (by default it is true
).