Same name and namespace in other branches
  1. 8.x-1.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 Returns entity types.

3 calls to __check_entity_type()
drush_exif_import in ./exif.drush.inc
The drush import.
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 202

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 {
            \Drupal::logger(dt('entity %entity is not supported.', [
                '%entity' => $entity_type,
            ]));
        }
    }
    return $entity_types;
}