Completed
Push — 8.x-1.x ( 48b271...fbaab6 )
by Janez
02:46
created

EntityBrowserDeleteForm   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 37
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getQuestion() 0 6 1
A getConfirmText() 0 3 1
A getCancelUrl() 0 3 1
A getDeletionMessage() 0 6 1
1
<?php
2
3
/**
4
 * @file
5
 * Contains Drupal\entity_browser\Form\EntityBrowserDeleteForm.
6
 */
7
8
namespace Drupal\entity_browser\Form;
9
10
use Drupal\Core\Entity\EntityDeleteForm;
11
use Drupal\Core\Url;
12
13
/**
14
 * Delete confirm form for entity browsers.
15
 */
16
class EntityBrowserDeleteForm extends EntityDeleteForm {
17
18
  /**
19
   * {@inheritdoc}
20
   */
21
  public function getQuestion() {
22
    return $this->t(
23
      'Are you sure you want to delete entity browser %label?',
24
      ['%label' => $this->entity->label()]
25
    );
26
  }
27
28
  /**
29
   * {@inheritdoc}
30
   */
31
  public function getConfirmText() {
32
    return $this->t('Delete Entity Browser');
33
  }
34
35
  /**
36
   * {@inheritdoc}
37
   */
38
  public function getCancelUrl() {
39
    return new Url('entity.entity_browser.collection');
40
  }
41
42
  /**
43
   * {@inheritdoc}
44
   */
45
  protected function getDeletionMessage() {
46
    return $this->t(
47
      'Entity browser %label was deleted.',
48
      ['%label' => $this->entity->label()]
49
    );
50
  }
51
52
}
53