You are here

public static function EntityHelper::extractIds in Commerce Core 8.2

Extracts the IDs of the given entities.

Parameters

\Drupal\Core\Entity\EntityInterface[] $entities: The entities.

Return value

array The entity IDs.

7 calls to EntityHelper::extractIds()
EntitySelectWidgetTest::testWidget in tests/src/Functional/EntitySelectWidgetTest.php
Tests widget's hidden input type.
PaymentOptionsBuilder::buildOptions in modules/payment/src/PaymentOptionsBuilder.php
Builds the payment options for the given order's payment gateways.
ProductAdminTest::testCreateProduct in modules/product/tests/src/Functional/ProductAdminTest.php
Tests creating a product.
ProductAdminTest::testEditProduct in modules/product/tests/src/Functional/ProductAdminTest.php
Tests editing a product.
ProductAdminTest::testVariationsTab in modules/product/tests/src/Functional/ProductAdminTest.php
Tests creating a product and its variations.

... See full list

File

src/EntityHelper.php, line 16

Class

EntityHelper

Namespace

Drupal\commerce

Code

public static function extractIds(array $entities) : array {
  return array_map(function ($entity) {

    /** @var \Drupal\Core\Entity\EntityInterface $entity */
    return $entity
      ->id();
  }, $entities);
}