BlockContentType.php
Namespace
Drupal\block_content\EntityFile
- 
              core/modules/ block_content/ src/ Entity/ BlockContentType.php 
View source
<?php
namespace Drupal\block_content\Entity;
use Drupal\block_content\BlockContentTypeForm;
use Drupal\block_content\BlockContentTypeListBuilder;
use Drupal\block_content\BlockTypeAccessControlHandler;
use Drupal\block_content\Form\BlockContentTypeDeleteForm;
use Drupal\block_content\Routing\BlockContentTypeRouteProvider;
use Drupal\Core\Entity\Attribute\ConfigEntityType;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
use Drupal\block_content\BlockContentTypeInterface;
use Drupal\user\Entity\EntityPermissionsRouteProvider;
/**
 * Defines the block type entity.
 */
class BlockContentType extends ConfigEntityBundleBase implements BlockContentTypeInterface {
  
  /**
   * The block type ID.
   *
   * @var string
   */
  protected $id;
  
  /**
   * The block type label.
   *
   * @var string
   */
  protected $label;
  
  /**
   * The default revision setting for content blocks of this type.
   *
   * @var bool
   */
  protected $revision = FALSE;
  
  /**
   * The description of the block type.
   *
   * @var string|null
   */
  protected $description = NULL;
  
  /**
   * {@inheritdoc}
   */
  public function getDescription() {
    return $this->description ?? '';
  }
  
  /**
   * {@inheritdoc}
   */
  public function setDescription($description) : static {
    return $this->set('description', $description);
  }
  
  /**
   * {@inheritdoc}
   */
  public function shouldCreateNewRevision() {
    return $this->revision;
  }
}Classes
| Title | Deprecated | Summary | 
|---|---|---|
| BlockContentType | Defines the block type entity. | 
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
