/** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->addEventSubscriber($this->channelTypeSubscriber); $builder->add('name', 'text', ['required' => true, 'label' => 'orocrm.channel.name.label']); $builder->add('entities', 'orocrm_channel_entities'); $builder->add('channelType', 'genemu_jqueryselect2_choice', ['choices' => $this->settingsProvider->getChannelTypeChoiceList(), 'required' => true, 'label' => 'orocrm.channel.channel_type.label', 'configs' => ['placeholder' => 'orocrm.channel.form.select_channel_type.label']]); $builder->add('status', 'choice', ['choices' => [Channel::STATUS_INACTIVE => 'orocrm.channel.inactive.label', Channel::STATUS_ACTIVE => 'orocrm.channel.active.label'], 'required' => true, 'label' => 'orocrm.channel.status.label']); }
/** * @return string */ protected function getFirstChannelType() { $channelTypes = $this->settingsProvider->getChannelTypeChoiceList(); reset($channelTypes); return (string) key($channelTypes); }
/** * {@inheritdoc} */ public function getChannelTypeMetadata() { return $this->settings->getChannelTypeChoiceList(); }