Skip to content
Snippets Groups Projects

Issue #3038365: Add the EntityOwnerInterface to BlockContent Entity

Open Adam Bramley requested to merge issue/drupal-3038365:3038365-11.x into 11.x
Compare and
5 files
+ 45
1
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -22,6 +22,7 @@
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\block_content\BlockContentInterface;
use Drupal\user\EntityOwnerTrait;
/**
* Defines the content block entity class.
@@ -46,6 +47,7 @@
'langcode' => 'langcode',
'uuid' => 'uuid',
'published' => 'status',
'owner' => 'uid',
],
handlers: [
'storage' => SqlContentEntityStorage::class,
@@ -99,6 +101,7 @@
class BlockContent extends EditorialContentEntityBase implements BlockContentInterface {
use RefinableDependentAccessTrait;
use EntityOwnerTrait;
/**
* The theme the block is being created in.
@@ -202,6 +205,7 @@ public function preSaveRevision(EntityStorageInterface $storage, \stdClass $reco
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
/** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */
$fields = parent::baseFieldDefinitions($entity_type);
$fields += static::ownerBaseFieldDefinitions($entity_type);
$fields['id']->setLabel(t('Content block ID'))
->setDescription(t('The content block ID.'));
Loading