Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
DetailType
n/a
0 / 0
n/a
0 / 0
0
n/a
0 / 0
1<?php
2
3namespace Drupal\crm\Entity;
4
5use Drupal\Core\Entity\Attribute\ConfigEntityType;
6use Drupal\Core\Entity\EntityDeleteForm;
7use Drupal\Core\StringTranslation\TranslatableMarkup;
8use Drupal\crm\DetailTypeListBuilder;
9use Drupal\crm\Form\DetailTypeForm;
10
11use Drupal\Core\Config\Entity\ConfigEntityBase;
12use Drupal\crm\CrmDetailTypeInterface;
13
14/**
15 * Defines the detail type entity type.
16 */
17#[ConfigEntityType(
18  id: 'crm_detail_type',
19  label: new TranslatableMarkup('Detail Type'),
20  label_collection: new TranslatableMarkup('Detail Types'),
21  label_singular: new TranslatableMarkup('detail type'),
22  label_plural: new TranslatableMarkup('detail types'),
23  label_count: [
24    'singular' => '@count detail type',
25    'plural' => '@count detail types',
26  ],
27  handlers: [
28    'form' => [
29      'add' => DetailTypeForm::class,
30      'edit' => DetailTypeForm::class,
31      'delete' => EntityDeleteForm::class,
32    ],
33    'list_builder' => DetailTypeListBuilder::class,
34  ],
35  admin_permission: 'administer crm',
36  config_prefix: 'crm_detail_type',
37  entity_keys: [
38    'id' => 'id',
39    'label' => 'label',
40    'uuid' => 'uuid',
41  ],
42  links: [
43    'add-form' => '/admin/structure/crm/detail-type/add',
44    'edit-form' => '/admin/structure/crm/detail-type/manage/{crm_detail_type}',
45    'delete-form' => '/admin/structure/crm/detail-type/manage/{crm_detail_type}/delete',
46    'collection' => '/admin/structure/crm/detail-type',
47  ],
48  config_export: [
49    'id',
50    'label',
51    'description',
52    'bundles',
53    'negate',
54  ],
55)]
56class DetailType extends ConfigEntityBase implements CrmDetailTypeInterface {
57
58  /**
59   * The detail type id.
60   *
61   * @var string
62   */
63  protected $id;
64
65  /**
66   * The detail type label.
67   *
68   * @var string
69   */
70  protected $label;
71
72  /**
73   * The detail type status.
74   *
75   * @var bool
76   */
77  protected $status;
78
79  /**
80   * The crm_detail_type description.
81   *
82   * @var string
83   */
84  protected $description;
85
86  /**
87   * The bundles associated with this detail type.
88   *
89   * @var array
90   */
91  protected $bundles;
92
93  /**
94   * The negate condition for this detail type.
95   *
96   * @var bool
97   */
98  protected $negate;
99
100}