BlockContentType.php

Same filename and directory in other branches
  1. 9 core/modules/block_content/src/Entity/BlockContentType.php
  2. 8.9.x core/modules/block_content/src/Entity/BlockContentType.php
  3. 10 core/modules/block_content/src/Entity/BlockContentType.php

Namespace

Drupal\block_content\Entity

File

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\Core\Entity\Attribute\ConfigEntityType;
use Drupal\Core\Entity\Routing\AdminHtmlRouteProvider;
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.