php - Doctrine 2 ObjectMultiCheckbox checked property -


i've got followed : zf2, doctrine 2, many many.

question: how can make checkboxes checked in view? seems can done using name convensions. can give me advice please?

relations are:

portfolio.php /**  * @var \doctrine\common\collections\collection  * @orm\manytomany(targetentity="worker", inversedby="portfolio")  * @orm\jointable(name="portfolio_workers",  * joincolumns={@orm\joincolumn(name="portfolio_id",referencedcolumnname="id")},  * inversejoincolumns={@orm\joincolumn(name="worker_id",referencedcolumnname="id")}   * )  */ private $workers; 

and

worker.php /**  * @orm\manytomany(targetentity="portfolio", mappedby="workers")  */ private $portfolio; 

and element add code is:

$this->add(array(         'name' => 'workerid',         'type' => 'doctrinemodule\form\element\objectmulticheckbox',         'options' => array(             'label' => 'teste',             'object_manager' => $this->getobjectmanager(),             'target_class'   => 'backend\entity\worker',             'property'       => 'name'         )     )); 

thanks all, seems i've found solution. i've changed form element code following:

$this->add(array(     'name' => 'workers',     'type' => 'doctrinemodule\form\element\objectmulticheckbox',     'options' => array(         'label' => 'teste',         'object_manager' => $this->getobjectmanager(),         'target_class'   => 'backend\entity\worker',         'property'       => 'name'     ) )); 

maybe can helpful sleepy guys me)


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -