| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function save(array $form, FormStateInterface $form_state) { |
||
| 30 | $entity = $this->entity; |
||
| 31 | $status = parent::save($form, $form_state); |
||
| 32 | |||
| 33 | switch ($status) { |
||
| 34 | case SAVED_NEW: |
||
| 35 | drupal_set_message($this->t('Created the %label Event template.', [ |
||
| 36 | '%label' => $entity->label(), |
||
| 37 | ])); |
||
| 38 | break; |
||
| 39 | |||
| 40 | default: |
||
| 41 | drupal_set_message($this->t('Saved the %label Event template.', [ |
||
| 42 | '%label' => $entity->label(), |
||
| 43 | ])); |
||
| 44 | } |
||
| 45 | $form_state->setRedirect('entity.mongodb_watchdog_event_template.canonical', ['mongodb_watchdog_event_template' => $entity->id()]); |
||
| 46 | } |
||
| 47 | |||
| 49 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.