3 namespace Drupal\block_content\Entity;
5 use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
6 use Drupal\block_content\BlockContentTypeInterface;
9 * Defines the custom block type entity.
12 * id = "block_content_type",
13 * label = @Translation("Custom block type"),
14 * label_collection = @Translation("Custom block types"),
15 * label_singular = @Translation("custom block type"),
16 * label_plural = @Translation("custom block types"),
17 * label_count = @PluralTranslation(
18 * singular = "@count custom block type",
19 * plural = "@count custom block types",
21 * label_collection = @Translation("Custom block library"),
24 * "default" = "Drupal\block_content\BlockContentTypeForm",
25 * "add" = "Drupal\block_content\BlockContentTypeForm",
26 * "edit" = "Drupal\block_content\BlockContentTypeForm",
27 * "delete" = "Drupal\block_content\Form\BlockContentTypeDeleteForm"
29 * "route_provider" = {
30 * "html" = "Drupal\Core\Entity\Routing\AdminHtmlRouteProvider"
32 * "list_builder" = "Drupal\block_content\BlockContentTypeListBuilder"
34 * admin_permission = "administer blocks",
35 * config_prefix = "type",
36 * bundle_of = "block_content",
42 * "delete-form" = "/admin/structure/block/block-content/manage/{block_content_type}/delete",
43 * "edit-form" = "/admin/structure/block/block-content/manage/{block_content_type}",
44 * "collection" = "/admin/structure/block/block-content/types",
54 class BlockContentType extends ConfigEntityBundleBase implements BlockContentTypeInterface {
57 * The custom block type ID.
64 * The custom block type label.
71 * The default revision setting for custom blocks of this type.
78 * The description of the block type.
82 protected $description;
87 public function getDescription() {
88 return $this->description;
94 public function shouldCreateNewRevision() {
95 return $this->revision;