Commit 52fdfaa5 authored by alexpott's avatar alexpott

Issue #2962304 by Sam152: EntityPublishedTrait should use getEntityKey for better performance

parent 8f8942bd
...@@ -45,8 +45,7 @@ public static function publishedBaseFieldDefinitions(EntityTypeInterface $entity ...@@ -45,8 +45,7 @@ public static function publishedBaseFieldDefinitions(EntityTypeInterface $entity
* {@inheritdoc} * {@inheritdoc}
*/ */
public function isPublished() { public function isPublished() {
$key = $this->getEntityType()->getKey('published'); return (bool) $this->getEntityKey('published');
return (bool) $this->get($key)->value;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment