Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / system / tests / modules / entity_test / src / Entity / EntityTestBundle.php
1 <?php
2
3 namespace Drupal\entity_test\Entity;
4
5 use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
6 use Drupal\Core\Entity\EntityDescriptionInterface;
7
8 /**
9  * Defines the Test entity bundle configuration entity.
10  *
11  * @ConfigEntityType(
12  *   id = "entity_test_bundle",
13  *   label = @Translation("Test entity bundle"),
14  *   handlers = {
15  *     "access" = "\Drupal\Core\Entity\EntityAccessControlHandler",
16  *     "form" = {
17  *       "default" = "\Drupal\Core\Entity\BundleEntityFormBase",
18  *     },
19  *     "route_provider" = {
20  *       "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
21  *     },
22  *   },
23  *   admin_permission = "administer entity_test_bundle content",
24  *   config_prefix = "entity_test_bundle",
25  *   bundle_of = "entity_test_with_bundle",
26  *   entity_keys = {
27  *     "id" = "id",
28  *     "label" = "label"
29  *   },
30  *   config_export = {
31  *     "id",
32  *     "label",
33  *     "description",
34  *   },
35  *   links = {
36  *     "add-form" = "/entity_test_bundle/add",
37  *   }
38  * )
39  */
40 class EntityTestBundle extends ConfigEntityBundleBase implements EntityDescriptionInterface {
41
42   /**
43    * The machine name.
44    *
45    * @var string
46    */
47   protected $id;
48
49   /**
50    * The human-readable name.
51    *
52    * @var string
53    */
54   protected $label;
55
56   /**
57    * The description.
58    *
59    * @var string
60    */
61   protected $description;
62
63   /**
64    * {@inheritdoc}
65    */
66   public function getDescription() {
67     return $this->description;
68   }
69
70   /**
71    * {@inheritdoc}
72    */
73   public function setDescription($description) {
74     $this->description = $description;
75     return $this;
76   }
77
78 }