You are here

function _drush_expire_entity in Cache Expiration 7.2

Internal function for expiration of all entities.

4 calls to _drush_expire_entity()
drush_expire_comment in ./expire.drush.inc
Callback for expire-comment drush command.
drush_expire_node in ./expire.drush.inc
Callback for expire-node drush command.
drush_expire_term in ./expire.drush.inc
Callback for expire-term drush command.
drush_expire_user in ./expire.drush.inc
Callback for expire-user drush command.

File

./expire.drush.inc, line 174
This is the drush integration for the expire module.

Code

function _drush_expire_entity($entity_type) {

  // Get drush params.
  $ids = drush_get_arguments();
  unset($ids[0]);
  $handler = _expire_get_expiration_handler($entity_type);
  $entities = entity_load($entity_type, $ids);
  if (is_object($handler) && !empty($entities)) {
    foreach ($entities as $entity) {
      $handler
        ->expire($entity, 0, $skip_action_check = TRUE);
    }
  }
}