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
Post a Comment