当前位置: 首页>>代码示例>>PHP>>正文


PHP EntityForm::copyFormValuesToEntity方法代码示例

本文整理汇总了PHP中Drupal\Core\Entity\EntityForm::copyFormValuesToEntity方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityForm::copyFormValuesToEntity方法的具体用法?PHP EntityForm::copyFormValuesToEntity怎么用?PHP EntityForm::copyFormValuesToEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\Core\Entity\EntityForm的用法示例。


在下文中一共展示了EntityForm::copyFormValuesToEntity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: copyFormValuesToEntity

 /**
  * {@inheritdoc}
  */
 protected function copyFormValuesToEntity(EntityInterface $payment_method_configuration, array $form, FormStateInterface $form_state)
 {
     /** @var \Drupal\payment\Entity\PaymentMethodConfigurationInterface $payment_method_configuration */
     parent::copyFormValuesToEntity($payment_method_configuration, $form, $form_state);
     $values = $form_state->getValues();
     /** @var \Drupal\payment\Plugin\Payment\MethodConfiguration\PaymentMethodConfigurationInterface $payment_method_configuration_plugin */
     $payment_method_configuration_plugin = $form_state->get('payment_method_configuration');
     $payment_method_configuration->setLabel($values['label']);
     $payment_method_configuration->setStatus($values['status']);
     $payment_method_configuration->setOwnerId($values['owner']);
     $payment_method_configuration->setPluginConfiguration($payment_method_configuration_plugin instanceof ConfigurablePluginInterface ? $payment_method_configuration_plugin->getConfiguration() : []);
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:15,代码来源:PaymentMethodConfigurationForm.php

示例2: copyFormValuesToEntity

 /**
  * {@inheritdoc}
  */
 protected function copyFormValuesToEntity(EntityInterface $payment_status, array $form, FormStateInterface $form_state)
 {
     /** @var \Drupal\payment\Entity\PaymentStatusInterface $payment_status */
     parent::copyFormValuesToEntity($payment_status, $form, $form_state);
     $values = $form_state->getValues();
     $payment_status->setId($values['id']);
     $payment_status->setLabel($values['label']);
     $selected_parent = $this->getParentPaymentStatusSelector($form_state)->getSelectedPlugin();
     $payment_status->setParentId($selected_parent ? $selected_parent->getPluginId() : NULL);
     $payment_status->setDescription($values['description']);
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:14,代码来源:PaymentStatusForm.php

示例3: copyFormValuesToEntity

 /**
  * {@inheritdoc}
  */
 protected function copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface $form_state)
 {
     /** @var \Drupal\media_entity\MediaBundleInterface $entity */
     parent::copyFormValuesToEntity($entity, $form, $form_state);
     // Use type configuration for the plugin that was chosen.
     $configuration = $form_state->getValue('type_configuration');
     $configuration = empty($configuration[$entity->getType()->getPluginId()]) ? [] : $configuration[$entity->getType()->getPluginId()];
     $entity->set('type_configuration', $configuration);
 }
开发者ID:sedurzu,项目名称:ildeposito8,代码行数:12,代码来源:MediaBundleForm.php


注:本文中的Drupal\Core\Entity\EntityForm::copyFormValuesToEntity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。