22
33namespace Drupal \commerce ;
44
5+ use Drupal \Core \Field \FieldDefinitionInterface ;
6+ use Drupal \entity \BundleFieldDefinition ;
7+
58/**
69 * Manages configurable fields based on field definitions.
710 *
@@ -12,7 +15,7 @@ interface ConfigurableFieldManagerInterface {
1215 /**
1316 * Creates a configurable field from the given field definition.
1417 *
15- * @param \Drupal\commerce \BundleFieldDefinition $field_definition
18+ * @param \Drupal\entity \BundleFieldDefinition $field_definition
1619 * The field definition.
1720 * @param bool $lock
1821 * Whether the created field should be locked.
@@ -25,10 +28,31 @@ interface ConfigurableFieldManagerInterface {
2528 */
2629 public function createField (BundleFieldDefinition $ field_definition , $ lock = TRUE );
2730
31+ /**
32+ * Configure display modes for the given field definition.
33+ *
34+ * @param string $field_name
35+ * The field name.
36+ * @param string $entity_type_id
37+ * The entity type ID.
38+ * @param string $bundle
39+ * The bundle.
40+ * @param array $modes
41+ * The display mode configuration, keyed by display type, then mode.
42+ * Display type is one of 'form' or 'view', with their values being arrays
43+ * keyed by display mode ID. The display modes are created if they do not
44+ * already exist.
45+ *
46+ * @throws \InvalidArgumentException
47+ * Thrown when given an incomplete field definition (missing name,
48+ * target entity type ID, or target bundle).
49+ */
50+ public function configureFieldDisplayModes ($ field_name , $ entity_type_id , $ bundle , $ modes );
51+
2852 /**
2953 * Deletes the configurable field created from the given field definition.
3054 *
31- * @param \Drupal\commerce \BundleFieldDefinition $field_definition
55+ * @param \Drupal\entity \BundleFieldDefinition $field_definition
3256 * The field definition.
3357 *
3458 * @throws \InvalidArgumentException
@@ -42,7 +66,7 @@ public function deleteField(BundleFieldDefinition $field_definition);
4266 /**
4367 * Checks whether the configurable field has data.
4468 *
45- * @param \Drupal\commerce \BundleFieldDefinition $field_definition
69+ * @param \Drupal\entity \BundleFieldDefinition $field_definition
4670 * The field definition.
4771 *
4872 * @return bool
0 commit comments