Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
CrmCaseType
n/a
0 / 0
n/a
0 / 0
0
n/a
0 / 0
1<?php
2
3namespace Drupal\crm_case\Entity;
4
5use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
6use Drupal\Core\Entity\EntityDeleteForm;
7use Drupal\Core\Entity\Routing\AdminHtmlRouteProvider;
8use Drupal\crm_case\Form\CrmCaseTypeForm;
9use Drupal\crm_case\CrmCaseTypeListBuilder;
10use Drupal\Core\Entity\Attribute\ConfigEntityType;
11use Drupal\Core\StringTranslation\TranslatableMarkup;
12
13/**
14 * Defines the Crm Case type configuration entity.
15 */
16#[ConfigEntityType(
17  id: 'crm_case_type',
18  label: new TranslatableMarkup('CRM Case type'),
19  label_collection: new TranslatableMarkup('CRM Case types'),
20  label_singular: new TranslatableMarkup('crm case type'),
21  label_plural: new TranslatableMarkup('crm cases types'),
22  label_count: [
23    'singular' => '@count crm cases type',
24    'plural' => '@count crm cases types',
25  ],
26  handlers: [
27    'form' => [
28      'add' => CrmCaseTypeForm::class,
29      'edit' => CrmCaseTypeForm::class,
30      'delete' => EntityDeleteForm::class,
31    ],
32    'list_builder' => CrmCaseTypeListBuilder::class,
33    'route_provider' => [
34      'html' => AdminHtmlRouteProvider::class,
35    ],
36  ],
37  admin_permission: 'administer crm',
38  bundle_of: 'crm_case',
39  config_prefix: 'crm_case_type',
40  entity_keys: [
41    'id' => 'id',
42    'label' => 'label',
43    'uuid' => 'uuid',
44  ],
45  links: [
46    'add-form' => '/admin/structure/crm_case_types/add',
47    'edit-form' => '/admin/structure/crm_case_types/manage/{crm_case_type}',
48    'delete-form' => '/admin/structure/crm_case_types/manage/{crm_case_type}/delete',
49    'collection' => '/admin/structure/crm_case_types',
50  ],
51  config_export: ['id', 'label', 'uuid'],
52)]
53class CrmCaseType extends ConfigEntityBundleBase {
54
55  /**
56   * The machine name of this crm case type.
57   *
58   * @var string
59   */
60  protected $id;
61
62  /**
63   * The human-readable name of the crm case type.
64   *
65   * @var string
66   */
67  protected $label;
68
69}