本文整理汇总了PHP中Pim\Bundle\CatalogBundle\Manager\ChannelManager::getChannelChoices方法的典型用法代码示例。如果您正苦于以下问题:PHP ChannelManager::getChannelChoices方法的具体用法?PHP ChannelManager::getChannelChoices怎么用?PHP ChannelManager::getChannelChoices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pim\Bundle\CatalogBundle\Manager\ChannelManager
的用法示例。
在下文中一共展示了ChannelManager::getChannelChoices方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validate
/**
* {@inheritdoc}
*/
public function validate($value, Constraint $constraint)
{
$channels = $this->manager->getChannelChoices();
if (0 === count($channels)) {
throw new ConstraintDefinitionException('No channel is set in the application');
}
$constraint->choices = array_keys($channels);
parent::validate($value, $constraint);
}
示例2: getChannelChoicesWithUserChannel
/**
* Get channel choices with user channel code first
*
* @return string[]
*/
public function getChannelChoicesWithUserChannel()
{
$channelChoices = $this->channelManager->getChannelChoices();
$userChannelCode = $this->getUserChannelCode();
if (array_key_exists($userChannelCode, $channelChoices)) {
return [$userChannelCode => $channelChoices[$userChannelCode]] + $channelChoices;
}
return $channelChoices;
}
示例3: getConfigurationFields
/**
* {@inheritdoc}
*/
public function getConfigurationFields()
{
return ['channel' => ['type' => 'choice', 'options' => ['choices' => $this->channelManager->getChannelChoices(), 'required' => true, 'select2' => true, 'label' => 'pim_base_connector.export.channel.label', 'help' => 'pim_base_connector.export.channel.help']], 'updatedCondition' => ['type' => 'choice', 'options' => ['required' => true, 'select2' => true, 'label' => 'pim_enhanced_connector.product_reader.updatedCondition.label', 'help' => 'pim_enhanced_connector.product_reader.updatedCondition.help', 'choices' => ['doNotApply' => 'pim_enhanced_connector.product_reader.updatedCondition.choices.doNotApply', 'fromDefinedDate' => 'pim_enhanced_connector.product_reader.updatedCondition.choices.fromDefinedDate', 'fromLastExecution' => 'pim_enhanced_connector.product_reader.updatedCondition.choices.fromLastExecution']]], 'updatedSince' => ['options' => ['required' => false, 'label' => 'pim_enhanced_connector.product_reader.updatedSince.label', 'help' => 'pim_enhanced_connector.product_reader.updatedSince.help']], 'enabledCondition' => ['type' => 'choice', 'options' => ['required' => true, 'select2' => true, 'help' => 'pim_enhanced_connector.product_reader.enabledCondition.help', 'label' => 'pim_enhanced_connector.product_reader.enabledCondition.label', 'choices' => ['onlyEnabled' => 'pim_enhanced_connector.product_reader.enabledCondition.choices.onlyEnabled', 'onlyDisabled' => 'pim_enhanced_connector.product_reader.enabledCondition.choices.onlyDisabled', 'doNotApply' => 'pim_enhanced_connector.product_reader.enabledCondition.choices.doNotApply']]], 'categorizationCondition' => ['type' => 'choice', 'options' => ['required' => true, 'select2' => true, 'help' => 'pim_enhanced_connector.product_reader.categorizationCondition.help', 'label' => 'pim_enhanced_connector.product_reader.categorizationCondition.label', 'choices' => ['onlyCategorized' => 'pim_enhanced_connector.product_reader.categorizationCondition.choices.onlyCategorized', 'onlyNonCategorized' => 'pim_enhanced_connector.product_reader.categorizationCondition.choices.onlyNonCategorized', 'doNotApply' => 'pim_enhanced_connector.product_reader.categorizationCondition.choices.doNotApply']]], 'completeCondition' => ['type' => 'choice', 'options' => ['required' => true, 'select2' => true, 'help' => 'pim_enhanced_connector.product_reader.completeCondition.help', 'label' => 'pim_enhanced_connector.product_reader.completeCondition.label', 'choices' => ['onlyComplete' => 'pim_enhanced_connector.product_reader.completeCondition.choices.onlyComplete', 'onlyUncomplete' => 'pim_enhanced_connector.product_reader.completeCondition.choices.onlyUncomplete', 'doNotApply' => 'pim_enhanced_connector.product_reader.completeCondition.choices.doNotApply']]]];
}
示例4: getConfigurationFields
/**
* Get fields for the twig
*
* @return array
*/
public function getConfigurationFields()
{
return array_merge(parent::getConfigurationFields(), ['channel' => ['type' => 'choice', 'options' => ['choices' => $this->channelManager->getChannelChoices(), 'required' => true, 'help' => 'actualys_drupal_commerce_connector.export.channel.help', 'label' => 'actualys_drupal_commerce_connector.export.channel.label']]]);
}
示例5: getConfigurationFields
/**
* {@inheritdoc}
*/
public function getConfigurationFields()
{
return ['channel' => ['type' => 'choice', 'options' => ['choices' => $this->channelManager->getChannelChoices(), 'required' => true, 'select2' => true, 'label' => 'pim_base_connector.export.channel.label', 'help' => 'pim_base_connector.export.channel.help']]];
}
示例6: getConfigurationFields
/**
* {@inheritdoc}
*/
public function getConfigurationFields()
{
return array_merge(parent::getConfigurationFields(), array('channel' => array('type' => 'choice', 'options' => array('choices' => $this->channelManager->getChannelChoices(), 'required' => true, 'select2' => true, 'label' => 'pim_base_connector.export.channel.label', 'help' => 'pim_base_connector.export.channel.help'))));
}
示例7: getConfigurationFields
/**
* {@inheritdoc}
*/
public function getConfigurationFields()
{
return array_merge(parent::getConfigurationFields(), ['channel' => ['type' => 'choice', 'options' => ['choices' => $this->channelManager->getChannelChoices(), 'required' => true, 'help' => 'pim_magento_connector.export.channel.help', 'label' => 'pim_magento_connector.export.channel.label']], 'enabled' => ['type' => 'switch', 'options' => ['required' => true, 'help' => 'pim_magento_connector.export.enabled.help', 'label' => 'pim_magento_connector.export.enabled.label']], 'visibility' => ['type' => 'text', 'options' => ['required' => true, 'help' => 'pim_magento_connector.export.visibility.help', 'label' => 'pim_magento_connector.export.visibility.label']], 'currency' => ['type' => 'choice', 'options' => ['choices' => $this->currencyManager->getCurrencyChoices(), 'required' => true, 'help' => 'pim_magento_connector.export.currency.help', 'label' => 'pim_magento_connector.export.currency.label', 'attr' => ['class' => 'select2']]]], $this->categoryMappingMerger->getConfigurationField(), $this->attributeMappingMerger->getConfigurationField());
}
示例8: getConfigurationFields
/**
* {@inheritdoc}
*/
public function getConfigurationFields()
{
return array_merge(parent::getConfigurationFields(), ['channel' => ['type' => 'choice', 'options' => ['choices' => $this->channelManager->getChannelChoices(), 'required' => true, 'help' => 'pim_prestashop_connector.export.channel.help', 'label' => 'pim_prestashop_connector.export.channel.label']], 'enabled' => ['type' => 'switch', 'options' => ['required' => true, 'help' => 'pim_prestashop_connector.export.enabled.help', 'label' => 'pim_prestashop_connector.export.enabled.label']], 'visibility' => ['type' => 'text', 'options' => ['required' => true, 'help' => 'pim_prestashop_connector.export.visibility.help', 'label' => 'pim_prestashop_connector.export.visibility.label']], 'variantMemberVisibility' => ['type' => 'text', 'options' => ['required' => true, 'help' => 'pim_prestashop_connector.export.variant_member_visibility.help', 'label' => 'pim_prestashop_connector.export.variant_member_visibility.label']], 'currency' => ['type' => 'choice', 'options' => ['choices' => $this->currencyManager->getCurrencyChoices(), 'required' => true, 'help' => 'pim_prestashop_connector.export.currency.help', 'label' => 'pim_prestashop_connector.export.currency.label', 'attr' => ['class' => 'select2']]], 'smallImageAttribute' => ['type' => 'choice', 'options' => ['choices' => $this->attributeManager->getImageAttributeChoice(), 'help' => 'pim_prestashop_connector.export.smallImageAttribute.help', 'label' => 'pim_prestashop_connector.export.smallImageAttribute.label', 'attr' => ['class' => 'select2']]], 'baseImageAttribute' => ['type' => 'choice', 'options' => ['choices' => $this->attributeManager->getImageAttributeChoice(), 'help' => 'pim_prestashop_connector.export.baseImageAttribute.help', 'label' => 'pim_prestashop_connector.export.baseImageAttribute.label', 'attr' => ['class' => 'select2']]], 'thumbnailAttribute' => ['type' => 'choice', 'options' => ['choices' => $this->attributeManager->getImageAttributeChoice(), 'help' => 'pim_prestashop_connector.export.thumbnailAttribute.help', 'label' => 'pim_prestashop_connector.export.thumbnailAttribute.label', 'attr' => ['class' => 'select2']]], 'urlKey' => ['type' => 'checkbox', 'options' => ['help' => 'pim_prestashop_connector.export.urlKey.help', 'label' => 'pim_prestashop_connector.export.urlKey.label']], 'skuFirst' => ['type' => 'checkbox', 'options' => ['help' => 'pim_prestashop_connector.export.skuFirst.help', 'label' => 'pim_prestashop_connector.export.skuFirst.label']]], $this->categoryMappingMerger->getConfigurationField(), $this->attributeMappingMerger->getConfigurationField());
}
示例9: getConfigurationFields
/**
* {@inheritdoc}
*/
public function getConfigurationFields()
{
return array('channel' => array('type' => 'choice', 'options' => array('choices' => $this->channelManager->getChannelChoices(), 'required' => true, 'select2' => true, 'label' => 'pim_base_connector.export.channel.label', 'help' => 'pim_base_connector.export.channel.help')), 'exportFrom' => array('required' => false, 'options' => array('help' => 'dnd_magento_connector.export.exportFrom.help', 'label' => 'dnd_magento_connector.export.exportFrom.label')), 'batchExportID' => array('required' => false, 'options' => array('help' => 'dnd_magento_connector.export.batchExportID.help', 'label' => 'dnd_magento_connector.export.batchExportID.label')), 'isEnabled' => array('type' => 'switch', 'required' => false, 'options' => array('help' => 'dnd_magento_connector.export.isEnabled.help', 'label' => 'dnd_magento_connector.export.isEnabled.label')), 'isComplete' => array('type' => 'switch', 'required' => false, 'options' => array('help' => 'dnd_magento_connector.export.isComplete.help', 'label' => 'dnd_magento_connector.export.isComplete.label')));
}
示例10: testGetChannelChoices
/**
* Test related method
*/
public function testGetChannelChoices()
{
$expectedArray = array('ecommerce' => 'Ecommerce', 'mobile' => 'Mobile');
$channelChoices = $this->manager->getChannelChoices();
$this->assertEquals($expectedArray, $channelChoices);
}