Skip to content

Commit 654bf3d

Browse files
bradjones1bojanz
authored andcommitted
Issue #2922811 by bradjones1, bojanz: Deprecate BundleFieldDefinition and BundlePluginInterface
1 parent 4ce7390 commit 654bf3d

File tree

14 files changed

+24
-13
lines changed

14 files changed

+24
-13
lines changed

modules/order/commerce_order.module

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Defines the Order entity and associated features.
66
*/
77

8-
use Drupal\commerce\BundleFieldDefinition;
8+
use Drupal\entity\BundleFieldDefinition;
99
use Drupal\commerce_order\Entity\OrderTypeInterface;
1010
use Drupal\Core\Form\FormStateInterface;
1111
use Drupal\Core\Render\Element;

modules/payment/src/Plugin/Commerce/PaymentMethodType/CreditCard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Drupal\commerce_payment\Plugin\Commerce\PaymentMethodType;
44

5-
use Drupal\commerce\BundleFieldDefinition;
5+
use Drupal\entity\BundleFieldDefinition;
66
use Drupal\commerce_payment\CreditCard as CreditCardHelper;
77
use Drupal\commerce_payment\Entity\PaymentMethodInterface;
88

modules/payment/src/Plugin/Commerce/PaymentMethodType/PayPal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Drupal\commerce_payment\Plugin\Commerce\PaymentMethodType;
44

5-
use Drupal\commerce\BundleFieldDefinition;
5+
use Drupal\entity\BundleFieldDefinition;
66
use Drupal\commerce_payment\Entity\PaymentMethodInterface;
77

88
/**

modules/payment/src/Plugin/Commerce/PaymentMethodType/PaymentMethodTypeInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Drupal\commerce_payment\Plugin\Commerce\PaymentMethodType;
44

5-
use Drupal\commerce\BundlePluginInterface;
5+
use Drupal\entity\BundlePlugin\BundlePluginInterface;
66
use Drupal\commerce_payment\Entity\PaymentMethodInterface;
77

88
/**

modules/payment/src/Plugin/Commerce/PaymentType/PaymentTypeInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Drupal\commerce_payment\Plugin\Commerce\PaymentType;
44

5-
use Drupal\commerce\BundlePluginInterface;
5+
use Drupal\entity\BundlePlugin\BundlePluginInterface;
66

77
/**
88
* Defines the interface for payment types.

modules/product/commerce_product.module

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Defines the Product entity and associated features.
66
*/
77

8-
use Drupal\commerce\BundleFieldDefinition;
8+
use Drupal\entity\BundleFieldDefinition;
99
use Drupal\commerce_product\Entity\ProductTypeInterface;
1010
use Drupal\Core\Cache\Cache;
1111
use Drupal\Core\Form\FormStateInterface;

src/BundleFieldDefinition.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
namespace Drupal\commerce;
44

5+
@trigger_error('The ' . __NAMESPACE__ . '\BundleFieldDefinition is deprecated. Instead, use \Drupal\entity\BundleFieldDefinition', E_USER_DEPRECATED);
6+
57
use Drupal\entity\BundleFieldDefinition as BaseBundleFieldDefinition;
68

79
/**
810
* Provides a field definition class for bundle fields.
911
*
1012
* Note: This code has moved to Entity API, see the parent class.
13+
*
14+
* @deprecated in Commerce 2.0
1115
*/
1216
class BundleFieldDefinition extends BaseBundleFieldDefinition {}

src/BundlePluginInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
namespace Drupal\commerce;
44

5+
@trigger_error('The ' . __NAMESPACE__ . '\BundlePluginInterface is deprecated. Instead, use \Drupal\entity\BundlePlugin\BundlePluginInterface', E_USER_DEPRECATED);
6+
57
use Drupal\entity\BundlePlugin\BundlePluginInterface as BaseBundlePluginInterface;
68

79
/**
810
* Interface for plugins which act as entity bundles.
911
*
1012
* Note: This code has moved to Entity API, see the parent class.
13+
*
14+
* @deprecated in Commerce 2.0
1115
*/
1216
interface BundlePluginInterface extends BaseBundlePluginInterface {}

src/ConfigurableFieldManager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Drupal\Core\Entity\EntityTypeManagerInterface;
66
use Drupal\field\Entity\FieldConfig;
77
use Drupal\field\Entity\FieldStorageConfig;
8+
use Drupal\entity\BundleFieldDefinition;
89

910
class ConfigurableFieldManager implements ConfigurableFieldManagerInterface {
1011

src/ConfigurableFieldManagerInterface.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Drupal\commerce;
44

5+
use Drupal\entity\BundleFieldDefinition;
6+
57
/**
68
* Manages configurable fields based on field definitions.
79
*
@@ -12,7 +14,7 @@ interface ConfigurableFieldManagerInterface {
1214
/**
1315
* Creates a configurable field from the given field definition.
1416
*
15-
* @param \Drupal\commerce\BundleFieldDefinition $field_definition
17+
* @param \Drupal\entity\BundleFieldDefinition $field_definition
1618
* The field definition.
1719
* @param bool $lock
1820
* Whether the created field should be locked.
@@ -28,7 +30,7 @@ public function createField(BundleFieldDefinition $field_definition, $lock = TRU
2830
/**
2931
* Deletes the configurable field created from the given field definition.
3032
*
31-
* @param \Drupal\commerce\BundleFieldDefinition $field_definition
33+
* @param \Drupal\entity\BundleFieldDefinition $field_definition
3234
* The field definition.
3335
*
3436
* @throws \InvalidArgumentException
@@ -42,7 +44,7 @@ public function deleteField(BundleFieldDefinition $field_definition);
4244
/**
4345
* Checks whether the configurable field has data.
4446
*
45-
* @param \Drupal\commerce\BundleFieldDefinition $field_definition
47+
* @param \Drupal\entity\BundleFieldDefinition $field_definition
4648
* The field definition.
4749
*
4850
* @return bool

0 commit comments

Comments
 (0)