You are here

function commerce_wishlist_get_purchasable_entity_types in Commerce Wishlist 8.3

Gets the purchasable entity types.

Return value

\Drupal\Core\Entity\EntityTypeInterface[] The purchasable entity types, keyed by entity type ID.

2 calls to commerce_wishlist_get_purchasable_entity_types()
commerce_wishlist_entity_bundle_info in ./commerce_wishlist.module
Implements hook_entity_bundle_info().
SettingsForm::buildForm in src/Form/SettingsForm.php
Form constructor.

File

./commerce_wishlist.module, line 357
Defines the Wishlist entity and associated features.

Code

function commerce_wishlist_get_purchasable_entity_types() {
  $entity_types = \Drupal::entityTypeManager()
    ->getDefinitions();
  return array_filter($entity_types, function (EntityTypeInterface $entity_type) {
    return $entity_type
      ->entityClassImplements(PurchasableEntityInterface::class);
  });
}