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

Implements Drush callback.

File

./exif.drush.inc, line 84

Code

function drush_exif_update($entity_type = '', $type = '') {
    $entity_types = __check_entity_type($entity_type);
    if (count($entity_types) == 0) {
        drush_log(dt('invalid entity type %type.', [
            '%type' => $entity_type,
        ]), "error");
        return;
    }
    $selected_types = __check_bundle($entity_types, $type);
    if (count($selected_types) == 0) {
        drush_log(dt('invalid type %type.', [
            '%type' => $type,
        ]), "error");
        return;
    }
    drush_log(dt('Need to update %count types.', [
        '%count' => count($selected_types),
    ]));
    foreach ($selected_types as $type) {
        if ($type['entity'] == 'node') {
            $count = __drush_exif_node_update($type['type']);
        }
        if ($type['entity'] == 'file') {
            $count = __drush_exif_file_update($type['type']);
        }
        if ($type['entity'] == 'media') {
            $count = __drush_exif_media_update($type['type']);
        }
    }
}