You are here

function __check_entity_type in Exif 8

Same name and namespace in other branches
  1. 8.2 exif.drush.inc \__check_entity_type()

Check an entity type is supported by this module.

Parameters

string $entity_type: Name of the entity type.

Return value

array

3 calls to __check_entity_type()
drush_exif_import in ./exif.drush.inc
drush_exif_list in ./exif.drush.inc
Implements Drush callback.
drush_exif_update in ./exif.drush.inc
Implements Drush callback.

File

./exif.drush.inc, line 193
Drush extension allowing to run some tasks related to exif.

Code

function __check_entity_type($entity_type = '') {
  $entity_types = [];
  if (in_array($entity_type, ENTITY_TYPE_SUPPORTED)) {
    $entity_types[] = $entity_type;
  }
  else {
    if ($entity_type == '') {
      $entity_types = ENTITY_TYPE_SUPPORTED;
    }
    else {
      drush_log(dt('entity %entity is not supported.', [
        '%entity' => $entity_type,
      ]), "error");
    }
  }
  return $entity_types;
}