Skip to content
Snippets Groups Projects

Issue #2965603 by jeffdavidgordon: Add support for UUID field to votingapi_result table

5 files
+ 61
3
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 8
1
@@ -5,6 +5,7 @@ namespace Drupal\votingapi\Entity;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Entity\ContentEntityBase;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\votingapi\VoteResultInterface;
/**
@@ -29,7 +30,8 @@ use Drupal\votingapi\VoteResultInterface;
* },
* base_table = "votingapi_result",
* entity_keys = {
* "id" = "id"
* "id" = "id",
* "uuid" = "uuid"
* }
* )
*/
@@ -130,6 +132,11 @@ class VoteResult extends ContentEntityBase implements VoteResultInterface {
->setReadOnly(TRUE)
->setSetting('unsigned', TRUE);
$fields[$entity_type->getKey('uuid')] = BaseFieldDefinition::create('uuid')
->setLabel(new TranslatableMarkup('UUID'))
->setDescription(new TranslatableMarkup('The vote result UUID.'))
->setReadOnly(TRUE);
$fields['type'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Type'))
->setDescription(t('The vote type.'))
Loading