PoolRequired.php in CMS Content Sync 2.1.x
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;
class PoolRequired extends ConfirmFormBase {
public function getFormId() {
return 'cms_content_sync_pool_required';
}
public function getDescription() {
return $this
->t('This will redirect you to the pool creation page.');
}
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?');
}
public function getCancelUrl() {
return new Url('entity.cms_content_sync_flow.collection');
}
public function getConfirmText() {
return $this
->t('Create pool');
}
public function buildForm(array $form, FormStateInterface $form_state) {
return parent::buildForm($form, $form_state);
}
public function submitForm(array &$form, FormStateInterface $form_state) {
$form_state
->setRedirect('entity.cms_content_sync_pool.add_form');
}
}