Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #537 from Gizra/feature/entity_uuid
Browse files Browse the repository at this point in the history
Add uuid field to OgMembership
  • Loading branch information
pfrenssen authored Jul 23, 2019
2 parents d26cf42 + 94c4032 commit 0006b99
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions og.install
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,16 @@ function og_update_8001(&$sandbox) {

return $message;
}

/**
* Add uuid field to OgMembership.
*/
function og_update_8002() {
$manager = \Drupal::entityDefinitionUpdateManager();
$entity_type = $manager->getEntityType('og_membership');
$entity_keys = $entity_type->getKeys();
$entity_keys['uuid'] = 'uuid';
$entity_type->set('entity_keys', $entity_keys);
$manager->updateEntityType($entity_type);
$manager->updateFieldStorageDefinition($manager->getFieldStorageDefinition('uuid', 'og_membership'));
}
1 change: 1 addition & 0 deletions src/Entity/OgMembership.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
* fieldable = TRUE,
* bundle_entity_type = "og_membership_type",
* entity_keys = {
* "uuid" = "uuid",
* "id" = "id",
* "bundle" = "type",
* },
Expand Down

0 comments on commit 0006b99

Please sign in to comment.