1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- namespace Drupal\dr8_zth\Entity;
- use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
- use Drupal\dr8_zth\BlogTypeInterface;
- /**
- * Defines the taxonomy vocabulary entity.
- *
- * @ConfigEntityType(
- * id = "blog_type",
- * label = @Translation("Blog type"),
- * handlers = {
- * "form" = {
- * "default" = "Drupal\dr8_zth\Form\BlogTypeForm",
- * "delete" = "Drupal\dr8_zth\Form\BlogTypeDeleteForm"
- * },
- * "list_builder" = "Drupal\dr8_zth\BlogTypeListBuilder",
- * },
- * admin_permission = "administer blog",
- * config_prefix = "type",
- * bundle_of = "blog",
- * entity_keys = {
- * "id" = "type",
- * "label" = "name",
- * },
- * links = {
- * "add-form" = "/admin/structure/blog/manage/{blog_type}/add",
- * "collection" = "/admin/structure/blog",
- * "delete-form" = "/admin/structure/blog/manage/{blog_type}/delete",
- * "edit-form" = "/admin/structure/blog/manage/{blog_type}"
- * },
- * config_export = {
- * "name",
- * "type",
- * "description",
- * }
- * )
- */
- class BlogType extends ConfigEntityBundleBase implements BlogTypeInterface {
- /**
- * The blog type description.
- *
- * @var string
- */
- protected $description;
- /**
- * The label entity_key.
- *
- * @var string
- */
- protected $name;
- /**
- * The id entity_key.
- *
- * @var string
- */
- protected $type;
- /**
- * {@inheritdoc}
- */
- public function id() {
- return $this->type;
- }
- /**
- * {@inheritdoc}
- */
- public function getDescription() {
- return $this->description;
- }
- /**
- * {@inheritdoc}
- */
- public function setDescription($description) {
- $this->description = $description;
- return $this;
- }
- }
|