Completed
Pull Request — 8.x-1.x (#126)
by Janez
03:15
created

EntityBrowserDeleteForm   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 3
Bugs 2 Features 0
Metric Value
wmc 4
c 3
b 2
f 0
lcom 0
cbo 0
dl 0
loc 35
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getQuestion() 0 5 1
A getConfirmText() 0 3 1
A getCancelUrl() 0 3 1
A getDeletionMessage() 0 5 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
use Drupal\Core\Form\FormStateInterface;
13
14
/**
15
 * Delete confirm form for entity browsers.
16
 */
17
class EntityBrowserDeleteForm extends EntityDeleteForm {
18
19
  /**
20
   * {@inheritdoc}
21
   */
22
  public function getQuestion() {
23
    return $this->t('Are you sure you want to delete entity browser %label?', array(
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('Entity_browser %label was deleted.', array(
47
      '%label' => $this->entity->label(),
48
    ));
49
  }
50
51
}
52