Skip to content
Snippets Groups Projects

Resolve #2965603 "Vote result uuid"

Open Tim Rohaly requested to merge issue/votingapi-2965603:2965603-vote-result-uuid into 4.0.x
4 files
+ 58
7
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 6
6
@@ -32,7 +32,8 @@ use Drupal\votingapi\VoteResultInterface;
@@ -32,7 +32,8 @@ use Drupal\votingapi\VoteResultInterface;
* },
* },
* base_table = "votingapi_result",
* base_table = "votingapi_result",
* entity_keys = {
* entity_keys = {
* "id" = "id"
* "id" = "id",
 
* "uuid" = "uuid",
* }
* }
* )
* )
*/
*/
@@ -127,11 +128,10 @@ class VoteResult extends ContentEntityBase implements VoteResultInterface {
@@ -127,11 +128,10 @@ class VoteResult extends ContentEntityBase implements VoteResultInterface {
*/
*/
public static function baseFieldDefinitions(EntityTypeInterface $entity_type): array {
public static function baseFieldDefinitions(EntityTypeInterface $entity_type): array {
/** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */
/** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */
$fields['id'] = BaseFieldDefinition::create('integer')
$fields = parent::baseFieldDefinitions($entity_type);
->setLabel(new TranslatableMarkup('ID'))
->setDescription(new TranslatableMarkup('The vote result ID.'))
// Override parent id description.
->setReadOnly(TRUE)
$fields['id']->setDescription(new TranslatableMarkup('The vote result ID.'));
->setSetting('unsigned', TRUE);
$fields['type'] = BaseFieldDefinition::create('entity_reference')
$fields['type'] = BaseFieldDefinition::create('entity_reference')
->setLabel(new TranslatableMarkup('Type'))
->setLabel(new TranslatableMarkup('Type'))
Loading