Same name and namespace in other branches
  1. 8.x-2.x exif.drush.inc \__check_entity_type() 1 comment

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 194

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;
}