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


PHP ConfigEntityBase::createDuplicate方法代码示例

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


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

示例1: testCreateDuplicate

 /**
  * @covers ::createDuplicate
  */
 public function testCreateDuplicate()
 {
     $this->entityType->expects($this->at(0))->method('getKey')->with('id')->will($this->returnValue('id'));
     $this->entityType->expects($this->at(1))->method('hasKey')->with('uuid')->will($this->returnValue(TRUE));
     $this->entityType->expects($this->at(2))->method('getKey')->with('uuid')->will($this->returnValue('uuid'));
     $new_uuid = '8607ef21-42bc-4913-978f-8c06207b0395';
     $this->uuid->expects($this->once())->method('generate')->will($this->returnValue($new_uuid));
     $duplicate = $this->entity->createDuplicate();
     $this->assertInstanceOf('\\Drupal\\Core\\Entity\\Entity', $duplicate);
     $this->assertNotSame($this->entity, $duplicate);
     $this->assertFalse($this->entity->isNew());
     $this->assertTrue($duplicate->isNew());
     $this->assertNull($duplicate->id());
     $this->assertNull($duplicate->getOriginalId());
     $this->assertNotEquals($this->entity->uuid(), $duplicate->uuid());
     $this->assertSame($new_uuid, $duplicate->uuid());
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:20,代码来源:ConfigEntityBaseUnitTest.php

示例2: createDuplicate

 /**
  * Overrides Drupal\Core\Config\Entity\ConfigEntityBase::createDuplicate().
  */
 public function createDuplicate()
 {
     $duplicate = parent::createDuplicate();
     unset($duplicate->executable);
     return $duplicate;
 }
开发者ID:shumer,项目名称:blog,代码行数:9,代码来源:View.php

示例3: createDuplicateBlock

 /**
  * {@inheritdoc}
  */
 public function createDuplicateBlock($new_id = NULL, $new_theme = NULL)
 {
     $duplicate = parent::createDuplicate();
     if (!empty($new_id)) {
         $duplicate->id = $new_id;
     }
     if (!empty($new_theme)) {
         $duplicate->theme = $new_theme;
     }
     return $duplicate;
 }
开发者ID:nsp15,项目名称:Drupal8,代码行数:14,代码来源:Block.php

示例4: createDuplicate

 /**
  * {@inheritdoc}
  */
 public function createDuplicate()
 {
     $duplicate = parent::createDuplicate();
     unset($duplicate->expression);
     return $duplicate;
 }
开发者ID:shahinam,项目名称:drupal8devel,代码行数:9,代码来源:RulesComponent.php

示例5: createDuplicate

 /**
  * {@inheritdoc}
  */
 public function createDuplicate()
 {
     $duplicate = parent::createDuplicate();
     unset($duplicate->componentObject);
     return $duplicate;
 }
开发者ID:Progressable,项目名称:openway8,代码行数:9,代码来源:RulesComponentConfig.php


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