Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function submit(array $form, array &$form_state)
 {
     parent::submit($form, $form_state);
     $this->entity->delete();
     drupal_set_message($this->t('View %name deleted', array('%name' => $this->entity->label())));
     $form_state['redirect_route'] = $this->getCancelUrl();
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function submit(array $form, FormStateInterface $form_state)
 {
     parent::submit($form, $form_state);
     $this->entity->delete();
     drupal_set_message($this->t('View %name deleted', array('%name' => $this->entity->label())));
     $form_state->setRedirectUrl($this->getCancelUrl());
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function submit(array $form, array &$form_state)
 {
     parent::submit($form, $form_state);
     $entity_type = $this->entity->getEntityType();
     drupal_set_message(t('Deleted the %label @entity-type.', array('%label' => $this->entity->label(), '@entity-type' => $entity_type->getLowercaseLabel())));
     $this->entity->delete();
     \Drupal::entityManager()->clearCachedFieldDefinitions();
     $form_state['redirect_route'] = $this->getCancelUrl();
 }