You are here

PoolRequired.php in CMS Content Sync 8

Same filename and directory in other branches
  1. 2.1.x src/Form/PoolRequired.php
  2. 2.0.x src/Form/PoolRequired.php

File

src/Form/PoolRequired.php
View source
<?php

namespace Drupal\cms_content_sync\Form;

use Drupal\Core\Form\ConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;

/**
 * Provides a node deletion confirmation form.
 *
 * @internal
 */
class PoolRequired extends ConfirmFormBase {

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'cms_content_sync_pool_required';
  }

  /**
   * {@inheritdoc}
   */
  public function getDescription() {
    return $this
      ->t('This will redirect you to the pool creation page.');
  }

  /**
   * {@inheritdoc}
   */
  public function getQuestion() {
    return $this
      ->t('Before you can create a flow, you have to create at least one pool before. Do you want to create a pool now?');
  }

  /**
   * {@inheritdoc}
   */
  public function getCancelUrl() {
    return new Url('entity.cms_content_sync_flow.collection');
  }

  /**
   * {@inheritdoc}
   */
  public function getConfirmText() {
    return $this
      ->t('Create pool');
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    return parent::buildForm($form, $form_state);
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $form_state
      ->setRedirect('entity.cms_content_sync_pool.add_form');
  }

}

Classes

Namesort descending Description
PoolRequired Provides a node deletion confirmation form.