當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。