我有以下选择形式的代码:
$this->add([
'name' => 'username',
'type' => 'DoctrineModule\Form\Element\ObjectSelect',
'options' => [
'object_manager' => $this->getObjectManager(),
'target_class' => 'Application\Entity\Player',
'property' => 'username',
'is_method' => true,
'empty_option' => '-- Please select Unsername --',
'find_method' => [
'name' => 'getUsername',
],
'label_generator' => function ($targetEntity) {
return $targetEntity->getId() ;
},
],
]);
我的问题是: