public function LTIToolProviderConsumerEntityController::deleteMultiple

cis7 LTIToolProviderConsumerEntityController.class.php public LTIToolProviderConsumerEntityController::deleteMultiple($entities)
cle7 LTIToolProviderConsumerEntityController.class.php public LTIToolProviderConsumerEntityController::deleteMultiple($entities)
elmsmedia7 LTIToolProviderConsumerEntityController.class.php public LTIToolProviderConsumerEntityController::deleteMultiple($entities)
icor7 LTIToolProviderConsumerEntityController.class.php public LTIToolProviderConsumerEntityController::deleteMultiple($entities)
meedjum_blog7 LTIToolProviderConsumerEntityController.class.php public LTIToolProviderConsumerEntityController::deleteMultiple($entities)
mooc7 LTIToolProviderConsumerEntityController.class.php public LTIToolProviderConsumerEntityController::deleteMultiple($entities)

Delete multiple consumers.

Parameters

array $entities: An array of consumers.

Throws

Exception From the db api.

1 call to LTIToolProviderConsumerEntityController::deleteMultiple()
LTIToolProviderConsumerEntityController::delete in sites/all/modules/ulmus/lti_tool_provider/LTIToolProviderConsumerEntityController.class.php
Delete a consumer.

File

sites/all/modules/ulmus/lti_tool_provider/LTIToolProviderConsumerEntityController.class.php, line 118
Contains LTIToolProviderConsumerEntityController.

Class

LTIToolProviderConsumerEntityController

Code

public function deleteMultiple($entities) {
  $ids = array();
  if (!empty($entities)) {
    $transaction = db_transaction();
    try {
      foreach ($entities as $entity) {
        module_invoke_all('lti_tool_provider_consumer_delete', $entity);
        // Invoke hook_entity_delete().
        module_invoke_all('entity_delete', $entity, 'lti_tool_provider_consumer');
        field_attach_delete('lti_tool_provider_consumer', $entity);
        $ids[] = $entity->lti_tool_provider_consumer_id;
      }
      db_delete('lti_tool_provider_consumer')->condition('lti_tool_provider_consumer_id', $ids, 'IN')->execute();
    }
    catch (Exception $e) {
      $transaction->rollback();
      watchdog_exception('lti_tool_provider_consumer', $e);
      throw $e;
    }
  }
}