You are here

function farm_api_uninstall in farmOS 2.x

Same name and namespace in other branches
  1. 7 modules/farm/farm_api/farm_api.install \farm_api_uninstall()

Implements hook_uninstall().

File

modules/core/api/farm_api.install, line 97
Install, update and uninstall functions for the farm_api module.

Code

function farm_api_uninstall() {

  // Load the default farm consumer.
  $consumers = \Drupal::entityTypeManager()
    ->getStorage('consumer')
    ->loadByProperties([
    'client_id' => 'farm',
  ]);

  // If found, delete the consumer.
  if (!empty($consumers)) {
    $farm_consumer = reset($consumers);
    $farm_consumer
      ->delete();
  }
}