/**
  * {@inheritdoc}
  */
 public function save(array $form, array &$form_state)
 {
     drupal_set_message(t('Saved the %label @entity-type.', array('%label' => $this->entity->label(), '@entity-type' => $this->entityType->getLowercaseLabel())));
     $this->entity->save();
     \Drupal::entityManager()->clearCachedFieldDefinitions();
     $form_state['redirect_route']['route_name'] = 'entity.' . $this->entity->getEntityTypeId() . '_list';
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     drupal_set_message($this->t('Saved the %label @entity-type.', array('%label' => $this->entity->label(), '@entity-type' => $this->entityType->getLowercaseLabel())));
     $this->entity->save();
     \Drupal::entityManager()->clearCachedFieldDefinitions();
     $form_state->setRedirectUrl($this->entity->urlInfo('collection'));
 }
 /**
  * {@inheritdoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     drupal_set_message(t('Saved the %label @entity-type.', array('%label' => $this->entity->label(), '@entity-type' => $this->entityType->getLowercaseLabel())));
     $this->entity->save();
     \Drupal::entityManager()->clearCachedFieldDefinitions();
     $form_state->setRedirect('entity.' . $this->entity->getEntityTypeId() . '_list');
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function getEntityTypeLabels()
 {
     $lowercase_label = $this->entityType->getLowercaseLabel();
     return ['singular' => $lowercase_label, 'plural' => t('@entity_type entities', ['@entity_type' => $lowercase_label])];
 }