forked from eileenmcnaughton/civicrm_entity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
civicrm_entity.install
44 lines (38 loc) · 1005 Bytes
/
civicrm_entity.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* @file
* Installation/Un-installation hooks for CiviCRM Entity.
*/
/**
* Implements hook_uninstall()
*
*/
function civicrm_entity_uninstall() {
drupal_load('module', 'civicrm_entity');
$civicrm_entity_info = civicrm_entity_get_supported_entity_info();
foreach ($civicrm_entity_info as $entity_type => $info) {
field_attach_delete_bundle($entity_type, $entity_type);
}
}
/**
* Implements hook_enable().
*
* Set weight higher than CiviCRM.
*
* @TODO Actually check what CiviCRM's weight should be.
*/
function civicrm_entity_enable() {
db_query("UPDATE {system} SET weight = 110 WHERE name = 'civicrm_entity'");
}
/**
* Blank hook_update_N() to help Drupal notice relocated files in 7.x-2.x.
*/
function civicrm_entity_update_7200() {
// This space intentionally left blank.
}
/**
* Flush all caches to help Drupal notice relocated files, additional entities, and updated metadata.
*/
function civicrm_entity_update_7201() {
drupal_flush_all_caches();
}