Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / module / configuration-entity / src / Entity / Example.php.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/Entity/Example.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/configuration-entity/src/Entity/Example.php.twig
new file mode 100644 (file)
index 0000000..e450f80
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+
+namespace Drupal\{{ machine_name }}\Entity;
+
+{% sort %}
+use Drupal\Core\Config\Entity\ConfigEntityBase;
+use Drupal\{{ machine_name }}\{{ class_prefix }}Interface;
+{% endsort %}
+
+/**
+ * Defines the {{ entity_type_label|lower }} entity type.
+ *
+ * @ConfigEntityType(
+ *   id = "{{ entity_type_id }}",
+ *   label = @Translation("{{ entity_type_label }}"),
+ *   handlers = {
+ *     "list_builder" = "Drupal\{{ machine_name }}\{{ class_prefix }}ListBuilder",
+ *     "form" = {
+ *       "add" = "Drupal\{{ machine_name }}\Form\{{ class_prefix }}Form",
+ *       "edit" = "Drupal\{{ machine_name }}\Form\{{ class_prefix }}Form",
+ *       "delete" = "Drupal\Core\Entity\EntityDeleteForm"
+ *     }
+ *   },
+ *   config_prefix = "{{ entity_type_id }}",
+ *   admin_permission = "administer {{ entity_type_id }}",
+ *   links = {
+ *     "collection" = "/admin/structure/{{ entity_type_id|u2h }}",
+ *     "add-form" = "/admin/structure/{{ entity_type_id|u2h }}/add",
+ *     "edit-form" = "/admin/structure/{{ entity_type_id|u2h }}/{{ '{' }}{{ entity_type_id }}{{ '}' }}",
+ *     "delete-form" = "/admin/structure/{{ entity_type_id|u2h }}/{{ '{' }}{{ entity_type_id }}{{ '}' }}/delete"
+ *   },
+ *   entity_keys = {
+ *     "id" = "id",
+ *     "label" = "label",
+ *     "uuid" = "uuid"
+ *   }
+ * )
+ */
+class {{ class_prefix }} extends ConfigEntityBase implements {{ class_prefix }}Interface {
+
+  /**
+   * The {{ entity_type_label|lower }} ID.
+   *
+   * @var string
+   */
+  protected $id;
+
+  /**
+   * The {{ entity_type_label|lower }} label.
+   *
+   * @var string
+   */
+  protected $label;
+
+  /**
+   * The {{ entity_type_label|lower }} status.
+   *
+   * @var bool
+   */
+  protected $status;
+
+  /**
+   * The {{ entity_type_id|lower }} description.
+   *
+   * @var string
+   */
+  protected $description;
+
+}