public function BundleEntityDuplicatorInterface::duplicate in Entity API 8
Duplicates the bundle entity, its fields and displays.
Parameters
\Drupal\Core\Config\Entity\ConfigEntityInterface $bundle_entity: The bundle entity.
array $values: An array of values to set, keyed by property name. Needs to at least contain a new ID.
Return value
\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.
1 method overrides BundleEntityDuplicatorInterface::duplicate()
- BundleEntityDuplicator::duplicate in src/
BundleEntityDuplicator.php - Duplicates the bundle entity, its fields and displays.
File
- src/
BundleEntityDuplicatorInterface.php, line 28
Class
- BundleEntityDuplicatorInterface
- Duplicates bundle entities, their fields and displays.
Namespace
Drupal\entityCode
public function duplicate(ConfigEntityInterface $bundle_entity, array $values);