You are here

function commerce_invoice_get_purchasable_entity_types in Commerce Invoice 8.2

Gets the purchasable entity types.

Return value

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

1 call to commerce_invoice_get_purchasable_entity_types()
commerce_invoice_entity_bundle_info in ./commerce_invoice.module
Implements hook_entity_bundle_info().

File

./commerce_invoice.module, line 54
Defines the Invoice entity and associated features.

Code

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