X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FEntity%2FEntityPublishedTrait.php;h=1f36625828e53c308f464ea39725609246744c42;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=871aceb365c333501a5e68725325293c5c4e7096;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php b/web/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php index 871aceb36..1f3662582 100644 --- a/web/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php +++ b/web/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php @@ -32,20 +32,20 @@ trait EntityPublishedTrait { throw new UnsupportedEntityTypeDefinitionException('The entity type ' . $entity_type->id() . ' does not have a "published" entity key.'); } - return [$entity_type->getKey('published') => BaseFieldDefinition::create('boolean') - ->setLabel(new TranslatableMarkup('Publishing status')) - ->setDescription(new TranslatableMarkup('A boolean indicating the published state.')) - ->setRevisionable(TRUE) - ->setTranslatable(TRUE) - ->setDefaultValue(TRUE)]; + return [ + $entity_type->getKey('published') => BaseFieldDefinition::create('boolean') + ->setLabel(new TranslatableMarkup('Published')) + ->setRevisionable(TRUE) + ->setTranslatable(TRUE) + ->setDefaultValue(TRUE), + ]; } /** * {@inheritdoc} */ public function isPublished() { - $key = $this->getEntityType()->getKey('published'); - return (bool) $this->get($key)->value; + return (bool) $this->getEntityKey('published'); } /**