コード例 #1
0
ファイル: ChannelType.php プロジェクト: dairdr/crm
 /**
  * {@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']);
 }
コード例 #2
0
 /**
  * @return string
  */
 protected function getFirstChannelType()
 {
     $channelTypes = $this->settingsProvider->getChannelTypeChoiceList();
     reset($channelTypes);
     return (string) key($channelTypes);
 }
コード例 #3
0
ファイル: MetadataProvider.php プロジェクト: dairdr/crm
 /**
  * {@inheritdoc}
  */
 public function getChannelTypeMetadata()
 {
     return $this->settings->getChannelTypeChoiceList();
 }