/** * @inheritdoc */ public function buildForm(FormBuilderInterface $builder, array $options) { // @todo as a service to load the preferred_choices $builder->add('title', 'text')->add('course_language', 'locale', array('preferred_choices' => array('en', 'fr', 'es')))->add('visibility', 'choice', array('choices' => Course::getStatusList()))->add('department_name', 'text', array('required' => false))->add('department_url', 'url', array('required' => false))->add('expiration_date', 'sonata_type_datetime_picker', array('required' => false))->add('save', 'submit', array('label' => 'Update')); }
/** * @param ListMapper $listMapper */ protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('title')->addIdentifier('code')->add('courseLanguage')->add('visibility', 'choice', array('choices' => Course::getStatusList())); }