BlockContent::getRevisionLogMessage

public BlockContent::getRevisionLogMessage() Returns the entity revision log message. Return value string The revision log message. Overrides RevisionLogInterface::getRevisionLogMessage File core/modules/block_content/src/Entity/BlockContent.php, line 281 Class BlockContent Defines the custom block entity class. Namespace Drupal\block_content\Entity Code public function getRevisionLogMessage() { return $this->get('revision_log')->value; }

BlockContent::getRevisionLog

public BlockContent::getRevisionLog() Returns the block revision log message. Return value string The revision log message. Overrides BlockContentInterface::getRevisionLog Deprecated in Drupal 8.2.0, will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\RevisionLogInterface::getRevisionLogMessage() instead. File core/modules/block_content/src/Entity/BlockContent.php, line 217 Class BlockContent Defines the custom block entity class. Namespace Drupal\block_content\Entity Code

BlockContent::getRevisionCreationTime

public BlockContent::getRevisionCreationTime() Gets the entity revision creation timestamp. Return value int The UNIX timestamp of when this revision was created. Overrides RevisionLogInterface::getRevisionCreationTime File core/modules/block_content/src/Entity/BlockContent.php, line 239 Class BlockContent Defines the custom block entity class. Namespace Drupal\block_content\Entity Code public function getRevisionCreationTime() { return $this->get('revision_created')->value; }

BlockContent::getInstances

public BlockContent::getInstances() Gets the configured instances of this custom block. Return value array Array of Drupal\block\Core\Plugin\Entity\Block entities. Overrides BlockContentInterface::getInstances File core/modules/block_content/src/Entity/BlockContent.php, line 122 Class BlockContent Defines the custom block entity class. Namespace Drupal\block_content\Entity Code public function getInstances() { return \Drupal::entityTypeManager()->getStorage('block')->loadByPro

BlockContent::delete

public BlockContent::delete() Deletes an entity permanently. Throws \Drupal\Core\Entity\EntityStorageException In case of failures an exception is thrown. Overrides Entity::delete File core/modules/block_content/src/Entity/BlockContent.php, line 143 Class BlockContent Defines the custom block entity class. Namespace Drupal\block_content\Entity Code public function delete() { foreach ($this->getInstances() as $instance) { $instance->delete(); } parent::delete(); }

BlockContent::createDuplicate

public BlockContent::createDuplicate() Creates a duplicate of the entity. Return value static A clone of $this with all identifiers unset, so saving it inserts a new entity into the storage system. Overrides ContentEntityBase::createDuplicate File core/modules/block_content/src/Entity/BlockContent.php, line 81 Class BlockContent Defines the custom block entity class. Namespace Drupal\block_content\Entity Code public function createDuplicate() { $duplicate = parent::createDuplicate()

BlockContent::baseFieldDefinitions

public static BlockContent::baseFieldDefinitions(EntityTypeInterface $entity_type) Provides base field definitions for an entity type. Implementations typically use the class \Drupal\Core\Field\BaseFieldDefinition for creating the field definitions; for example a 'name' field could be defined as the following: $fields['name'] = BaseFieldDefinition::create('string') ->setLabel(t('Name')); By definition, base fields are fields that exist for every bundle. To provide definitions for fields

BlockContent::$theme

The theme the block is being created in. When creating a new custom block from the block library, the user is redirected to the configure form for that block in the given theme. The theme is stored against the block when the custom block add form is shown. Type: string File core/modules/block_content/src/Entity/BlockContent.php, line 76 Class BlockContent Defines the custom block entity class. Namespace Drupal\block_content\Entity Code protected $theme;

BlockContent

Defines the custom block entity class. @ContentEntityType( id = "block_content", label = @Translation("Custom block"), bundle_label = @Translation("Custom block type"), handlers = { "storage" = "Drupal\Core\Entity\Sql\SqlContentEntityStorage", "access" = "Drupal\block_content\BlockContentAccessControlHandler", "list_builder" = "Drupal\block_content\BlockContentListBuilder", "view_builder" = "Drupal\block_content\BlockContentViewBuilder", "views_data" = "Drupal\block_content\BlockContentViewsDat

BlockBase::__construct

public BlockBase::__construct(array $configuration, $plugin_id, $plugin_definition) Overrides \Drupal\Component\Plugin\PluginBase::__construct(). Overrides the construction of context aware plugins to allow for unvalidated constructor based injection of contexts. Parameters array $configuration: The plugin configuration, i.e. an array with configuration values keyed by configuration option name. The special key 'context' may be used to initialize the defined contexts by setting it to an array