0
// src/AdminBundle/Entity/RentalUnitAdmin.php
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('name', 'text')
->add('location', 'entity', array('class' => 'AppBundle:Location'))
->add('rentalUnitPriceGroups', 'collection', array(
'entry_type' => RentalUnitPriceGroupForm::class,
'entry_options' => array('rentalUnit' => $formMapper -> getFormBuilder() -> getData()),
'allow_add' => true,
))
->add('rentalCategory', 'entity', array('class' => 'AppBundle:RentalCategory',
'choice_label' => 'name',))
;
}
別の管理クラスを使用して手動でRentalUnitクラスを選択する必要はありませんか、それとも可能ですか?私は管理クラス内にクラスを見つけることができますか?
もっと具体的に教えてください。 '' RentalUnitAdmin''を使用していて、 '' RentalUnit''の新しいインスタンスが必要ですか? –