interface EntityTraitManagerInterface in Commerce Core 8.2
Defines the interface for commerce_entity_trait plugin managers.
Hierarchy
- interface \Drupal\Component\Plugin\Discovery\DiscoveryInterface; interface \Drupal\Component\Plugin\Factory\FactoryInterface; interface \Drupal\Component\Plugin\Mapper\MapperInterface
- interface \Drupal\Component\Plugin\PluginManagerInterface
- interface \Drupal\commerce\EntityTraitManagerInterface
- interface \Drupal\Component\Plugin\PluginManagerInterface
Expanded class hierarchy of EntityTraitManagerInterface
All classes that implement EntityTraitManagerInterface
4 files declare their use of EntityTraitManagerInterface
- CommerceBundleEntityFormBase.php in src/
Form/ CommerceBundleEntityFormBase.php - OrderTypeForm.php in modules/
order/ src/ Form/ OrderTypeForm.php - ProductTypeForm.php in modules/
product/ src/ Form/ ProductTypeForm.php - ProductVariationTypeForm.php in modules/
product/ src/ Form/ ProductVariationTypeForm.php
File
- src/
EntityTraitManagerInterface.php, line 11
Namespace
Drupal\commerceView source
interface EntityTraitManagerInterface extends PluginManagerInterface {
/**
* Gets the definitions filtered by entity type.
*
* @param string $entity_type_id
* The entity type id.
*
* @return array
* The definitions.
*/
public function getDefinitionsByEntityType($entity_type_id);
/**
* Detects conflicts between the given trait and the installed traits.
*
* A conflict exists if the given trait has a field with a name that's already
* taken by a field from an installed trait.
*
* @param \Drupal\commerce\Plugin\Commerce\EntityTrait\EntityTraitInterface $trait
* The trait.
* @param \Drupal\commerce\Plugin\Commerce\EntityTrait\EntityTraitInterface[] $installed_traits
* The installed traits.
*/
public function detectConflicts(EntityTraitInterface $trait, array $installed_traits);
/**
* Installs the given trait for the given entity type and bundle.
*
* Installing a trait attaches any fields that the trait provides to the
* given bundle.
*
* @param \Drupal\commerce\Plugin\Commerce\EntityTrait\EntityTraitInterface $trait
* The trait.
* @param string $entity_type_id
* The entity type id.
* @param string $bundle
* The bundle.
*/
public function installTrait(EntityTraitInterface $trait, $entity_type_id, $bundle);
/**
* Checks whether the given trait can be uninstalled.
*
* A trait can only be uninstalled if the fields it provides contain no data.
*
* @param \Drupal\commerce\Plugin\Commerce\EntityTrait\EntityTraitInterface $trait
* The trait.
* @param string $entity_type_id
* The entity type id.
* @param string $bundle
* The bundle.
*/
public function canUninstallTrait(EntityTraitInterface $trait, $entity_type_id, $bundle);
/**
* Uninstalls the given trait for the given entity type and bundle.
*
* Uninstalling a trait removes any fields that the trait provides from the
* given bundle.
*
* @param \Drupal\commerce\Plugin\Commerce\EntityTrait\EntityTraitInterface $trait
* The trait.
* @param string $entity_type_id
* The entity type id.
* @param string $bundle
* The bundle.
*/
public function uninstallTrait(EntityTraitInterface $trait, $entity_type_id, $bundle);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DiscoveryInterface:: |
public | function | Gets a specific plugin definition. | 4 |
DiscoveryInterface:: |
public | function | Gets the definition of all plugins for this type. | 3 |
DiscoveryInterface:: |
public | function | Indicates if a specific plugin definition exists. | 2 |
EntityTraitManagerInterface:: |
public | function | Checks whether the given trait can be uninstalled. | 1 |
EntityTraitManagerInterface:: |
public | function | Detects conflicts between the given trait and the installed traits. | 1 |
EntityTraitManagerInterface:: |
public | function | Gets the definitions filtered by entity type. | 1 |
EntityTraitManagerInterface:: |
public | function | Installs the given trait for the given entity type and bundle. | 1 |
EntityTraitManagerInterface:: |
public | function | Uninstalls the given trait for the given entity type and bundle. | 1 |
FactoryInterface:: |
public | function | Creates a pre-configured instance of a plugin. | 7 |
MapperInterface:: |
public | function | Gets a preconfigured instance of a plugin. | 4 |