Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function finish(array &$form, FormStateInterface $form_state)
 {
     $cached_values = $form_state->getTemporaryValue('wizard');
     drupal_set_message($this->t('Value One: @one', ['@one' => $cached_values['one']]));
     drupal_set_message($this->t('Value Two: @two', ['@two' => $cached_values['two']]));
     parent::finish($form, $form_state);
 }
 /**
  * {@inheritdoc}
  */
 public function finish(array &$form, FormStateInterface $form_state)
 {
     $cached_values = $form_state->getTemporaryValue('wizard');
     /** @var $entity \Drupal\Core\Entity\EntityInterface */
     $entity = $cached_values[$this->getEntityType()];
     $entity->set('id', $cached_values['id']);
     $entity->set('label', $cached_values['label']);
     $status = $entity->save();
     $definition = $this->entityManager->getDefinition($this->getEntityType());
     if ($status) {
         drupal_set_message($this->t('Saved the %label !entity_type.', array('%label' => $entity->label(), '!entity_type' => $definition->getLabel())));
     } else {
         drupal_set_message($this->t('The %label !entity_type was not saved.', array('%label' => $entity->label(), '!entity_type' => $definition->getLabel())));
     }
     $form_state->setRedirectUrl($entity->urlInfo('collection'));
     parent::finish($form, $form_state);
 }
 /**
  * {@inheritdoc}
  */
 public function finish(array &$form, FormStateInterface $form_state)
 {
     parent::finish($form, $form_state);
 }