interface BundleEntityDuplicatorInterface in Entity API 8
Duplicates bundle entities, their fields and displays.
Hierarchy
- interface \Drupal\entity\BundleEntityDuplicatorInterface
Expanded class hierarchy of BundleEntityDuplicatorInterface
All classes that implement BundleEntityDuplicatorInterface
1 file declares its use of BundleEntityDuplicatorInterface
- EntityDuplicateSubscriber.php in src/
EventSubscriber/ EntityDuplicateSubscriber.php
File
- src/
BundleEntityDuplicatorInterface.php, line 10
Namespace
Drupal\entityView source
interface BundleEntityDuplicatorInterface {
/**
* Duplicates the bundle entity, its fields and displays.
*
* @param \Drupal\Core\Config\Entity\ConfigEntityInterface $bundle_entity
* The bundle entity.
* @param array $values
* An array of values to set, keyed by property name. Needs to at least
* contain a new ID.
*
* @return \Drupal\Core\Config\Entity\ConfigEntityInterface
* The new bundle entity, after it has been saved.
*
* @throws \InvalidArgumentException
* Thrown if the given entity is not a bundle entity, or if $values does
* not contain a new ID.
*/
public function duplicate(ConfigEntityInterface $bundle_entity, array $values);
/**
* Duplicates the bundle entity's fields.
*
* @param \Drupal\Core\Config\Entity\ConfigEntityInterface $bundle_entity
* The bundle entity.
* @param string $target_bundle_id
* The target bundle ID.
*
* @throws \InvalidArgumentException
* Thrown if the given entity is not a bundle entity.
*/
public function duplicateFields(ConfigEntityInterface $bundle_entity, $target_bundle_id);
/**
* Duplicates the bundle entity's view/form displays.
*
* @param \Drupal\Core\Config\Entity\ConfigEntityInterface $bundle_entity
* The bundle entity.
* @param string $target_bundle_id
* The target bundle ID.
*
* @throws \InvalidArgumentException
* Thrown if the given entity is not a bundle entity.
*/
public function duplicateDisplays(ConfigEntityInterface $bundle_entity, $target_bundle_id);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BundleEntityDuplicatorInterface:: |
public | function | Duplicates the bundle entity, its fields and displays. | 1 |
BundleEntityDuplicatorInterface:: |
public | function | Duplicates the bundle entity's view/form displays. | 1 |
BundleEntityDuplicatorInterface:: |
public | function | Duplicates the bundle entity's fields. | 1 |