Created
July 29, 2015 08:59
-
-
Save docteurklein/6912d7482d9356699de7 to your computer and use it in GitHub Desktop.
how to make the selected offer checked?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$data = [ | |
'offer' => new OfferForCustomer($ticket->getCustomer(), $ticket->getOffer(), 0, 0, 0), | |
]; | |
$form = $this->createForm('season_ticket', $data, [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$builder | |
->add('offer', 'choice', [ | |
'data_class' => 'App\Domain\Model\OfferForCustomer', // i have to specify it or it will only accept scalar during setData | |
'constraints' => [new Assert\NotBlank], | |
'choices' => $this->offers->getAvailableOffers($options['customer'], $options['seller']), // array of VOs | |
'expanded' => true, | |
'choices_as_values' => true, | |
'choice_label' => 'name', | |
'choice_value' => 'id', | |
]) | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment