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


PHP FieldStorageDefinitionInterface::save方法代码示例

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


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

示例1: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp($import_test_views = TRUE)
 {
     parent::setUp();
     $field_name = 'test_options';
     $this->fieldStorage = FieldStorageConfig::create(['field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'list_string', 'cardinality' => 1, 'settings' => ['allowed_values_function' => 'options_test_dynamic_values_callback']]);
     $this->fieldStorage->save();
     $this->field = FieldConfig::create(['field_name' => $field_name, 'entity_type' => 'entity_test', 'bundle' => 'entity_test', 'required' => TRUE])->save();
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:11,代码来源:ViewsDataTest.php

示例2: setUp

 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $field_name = 'test_options';
     $this->fieldStorage = entity_create('field_storage_config', ['field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'list_string', 'cardinality' => 1, 'settings' => ['allowed_values_function' => 'options_test_dynamic_values_callback']]);
     $this->fieldStorage->save();
     $this->field = entity_create('field_config', ['field_name' => $field_name, 'entity_type' => 'entity_test', 'bundle' => 'entity_test', 'required' => TRUE])->save();
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:11,代码来源:ViewsDataTest.php

示例3: setUp

 protected function setUp()
 {
     parent::setUp();
     $field_name = 'test_options';
     $this->fieldStorage = FieldStorageConfig::create(['field_name' => $field_name, 'entity_type' => 'entity_test_rev', 'type' => 'list_string', 'cardinality' => 1, 'settings' => ['allowed_values_function' => 'options_test_dynamic_values_callback']]);
     $this->fieldStorage->save();
     $this->field = FieldConfig::create(['field_name' => $field_name, 'entity_type' => 'entity_test_rev', 'bundle' => 'entity_test_rev', 'required' => TRUE])->save();
     entity_get_form_display('entity_test_rev', 'entity_test_rev', 'default')->setComponent($field_name, ['type' => 'options_select'])->save();
     // Create an entity and prepare test data that will be used by
     // options_test_dynamic_values_callback().
     $values = ['user_id' => mt_rand(1, 10), 'name' => $this->randomMachineName()];
     $this->entity = EntityTestRev::create($values);
     $this->entity->save();
     $this->test = ['label' => $this->entity->label(), 'uuid' => $this->entity->uuid(), 'bundle' => $this->entity->bundle(), 'uri' => $this->entity->url()];
 }
开发者ID:sojo,项目名称:d8_friendsofsilence,代码行数:15,代码来源:OptionsDynamicValuesTestBase.php


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