You are here

public function SocialPostEntityDeleteForm::getCancelUrl in Social Post 3.x

Same name and namespace in other branches
  1. 8.2 src/Form/SocialPostEntityDeleteForm.php \Drupal\social_post\Form\SocialPostEntityDeleteForm::getCancelUrl()

Returns the route to go to if the user cancels the action.

Return value

\Drupal\Core\Url A URL object.

Overrides ContentEntityDeleteForm::getCancelUrl

File

src/Form/SocialPostEntityDeleteForm.php, line 121

Class

SocialPostEntityDeleteForm
Provides a form for deleting Social Post user entities.

Namespace

Drupal\social_post\Form

Code

public function getCancelUrl() {

  // If a user id is passed as a parameter, the form is being invoked from a
  // user edit form.
  if ($this->uid) {
    return Url::fromRoute('entity.user.edit_form', [
      'user' => $this->uid,
    ]);
  }
  return Url::fromRoute('social_post_' . $this->provider . '.user.collection');
}