You are here

public static function Utility::classInArray in Commerce Migrate 8.2

Same name and namespace in other branches
  1. 3.1.x src/Utility.php \Drupal\commerce_migrate\Utility::classInArray()
  2. 3.0.x src/Utility.php \Drupal\commerce_migrate\Utility::classInArray()

Determine if a class is in a list of class names.

Parameters

object|string $className: Class name of plugin.

array $classes: List of classes to compare.

bool $allowString: If set to FALSE, string class name as object is not allowed. This also prevents calling autoloader if the class doesn't exist.

Return value

bool TRUE if it is a class in the list or else FALSE.

3 calls to Utility::classInArray()
commerce_migrate_ubercart_migration_plugins_alter in modules/ubercart/commerce_migrate_ubercart.module
Implements hook_migration_plugins_alter().
commerce_migrate_ubercart_update_8201 in modules/ubercart/commerce_migrate_ubercart.module
Update map table for the d7 field migration to migrate field values.
PrepareRow::onPrepareRow in modules/ubercart/src/EventSubscriber/PrepareRow.php
Responds to prepare row event.

File

src/Utility.php, line 26

Class

Utility
Class Utility.

Namespace

Drupal\commerce_migrate

Code

public static function classInArray($className, array $classes, $allowString = TRUE) {
  foreach ($classes as $class) {
    if (is_a($className, $class, $allowString)) {
      return TRUE;
    }
  }
  return FALSE;
}