D
D
drakulitka2016-06-06 13:22:59
Doctrine ORM
drakulitka, 2016-06-06 13:22:59

Loading an object in a Zend Form Select using Doctrine - Zend Expressive 1.0?

How can I load data from the database into the form (drop-down list element) using doctrine (Doctrine ORM), using the Zend Expressive and ZendForm framework. It used to be possible with DoctrineModule or DoctrineORMModule for Zend Framework 2, but it is no longer compatible with Zend Expressive.
Deprecated method:

$this->add(array(
           'name' => 'continent',
           'type' => 'DoctrineModule\Form\Element\ObjectSelect',
           'options' => array(
                'object_manager'     => $this->entityManager,
                'target_class'       => 'Tutorial\Entity\Countries',
                'property' => 'continent',
                'is_method' => true,
                'find_method'        => array(
                    'name'   => 'getContinent',
                ),
            ), 
        ));

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question