Backup of db before drupal security update
[yaffs-website] / web / core / modules / block_content / src / Entity / BlockContentType.php
1 <?php
2
3 namespace Drupal\block_content\Entity;
4
5 use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
6 use Drupal\block_content\BlockContentTypeInterface;
7
8 /**
9  * Defines the custom block type entity.
10  *
11  * @ConfigEntityType(
12  *   id = "block_content_type",
13  *   label = @Translation("Custom block type"),
14  *   handlers = {
15  *     "form" = {
16  *       "default" = "Drupal\block_content\BlockContentTypeForm",
17  *       "add" = "Drupal\block_content\BlockContentTypeForm",
18  *       "edit" = "Drupal\block_content\BlockContentTypeForm",
19  *       "delete" = "Drupal\block_content\Form\BlockContentTypeDeleteForm"
20  *     },
21  *     "list_builder" = "Drupal\block_content\BlockContentTypeListBuilder"
22  *   },
23  *   admin_permission = "administer blocks",
24  *   config_prefix = "type",
25  *   bundle_of = "block_content",
26  *   entity_keys = {
27  *     "id" = "id",
28  *     "label" = "label"
29  *   },
30  *   links = {
31  *     "delete-form" = "/admin/structure/block/block-content/manage/{block_content_type}/delete",
32  *     "edit-form" = "/admin/structure/block/block-content/manage/{block_content_type}",
33  *     "collection" = "/admin/structure/block/block-content/types",
34  *   },
35  *   config_export = {
36  *     "id",
37  *     "label",
38  *     "revision",
39  *     "description",
40  *   }
41  * )
42  */
43 class BlockContentType extends ConfigEntityBundleBase implements BlockContentTypeInterface {
44
45   /**
46    * The custom block type ID.
47    *
48    * @var string
49    */
50   protected $id;
51
52   /**
53    * The custom block type label.
54    *
55    * @var string
56    */
57   protected $label;
58
59   /**
60    * The default revision setting for custom blocks of this type.
61    *
62    * @var bool
63    */
64   protected $revision;
65
66   /**
67    * The description of the block type.
68    *
69    * @var string
70    */
71   protected $description;
72
73   /**
74    * {@inheritdoc}
75    */
76   public function getDescription() {
77     return $this->description;
78   }
79
80   /**
81    * {@inheritdoc}
82    */
83   public function shouldCreateNewRevision() {
84     return $this->revision;
85   }
86
87 }