You are here

protected function PoolForm::getDefaults in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/Form/PoolForm.php \Drupal\cms_content_sync\Form\PoolForm::getDefaults()
  2. 2.0.x src/Form/PoolForm.php \Drupal\cms_content_sync\Form\PoolForm::getDefaults()

Get default values that were provided in the URL.

Return value

array

1 call to PoolForm::getDefaults()
PoolForm::form in src/Form/PoolForm.php
Gets the actual form array to be built.

File

src/Form/PoolForm.php, line 331

Class

PoolForm
Form handler for the Pool add and edit forms.

Namespace

Drupal\cms_content_sync\Form

Code

protected function getDefaults(FormStateInterface $form_state) {
  return [
    'backend_url' => empty($_GET['backend_url']) ? $form_state
      ->getValue('default_backend_url') : $_GET['backend_url'],
    'name' => empty($_GET['name']) ? $form_state
      ->getValue('default_name') : $_GET['name'],
    'id' => empty($_GET['id']) ? $form_state
      ->getValue('default_id') : $_GET['id'],
  ];
}