You are here

function drush_entity_update_entity_check in Entity Update 2.0.x

Same name and namespace in other branches
  1. 8 entity_update.drush.inc \drush_entity_update_entity_check()

Call back function of entity-check.

File

drush/entity_update.drush8.inc, line 184
Entity update module (entity_update).

Code

function drush_entity_update_entity_check($type = NULL) {

  // Options which hasn't need to have entity type.
  if (drush_get_option('types')) {

    // Display entity types list.
    EntityCheck::getEntityTypesList($type);
    return;
  }

  // Options need to have an entity type.
  if ($type) {
    if (drush_get_option('list')) {

      // Display entity types list.
      $length = drush_get_option('length') ?: 10;
      EntityCheck::getEntityList($type, drush_get_option('start'), $length);
      return;
    }

    // Default action. Show the summary of the entity type.
    EntityUpdatePrint::displaySummery($type);
    return;
  }
  drush_log('No option specified, please type "drush help upec" for help or refer to the documentation.', 'cancel');
}