You are here

protected function ReplicationActionForm::getDefaultTarget in Deploy - Content Staging 8

Returns a target object.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: Form State values.

Return value

mixed The target object itself.

1 call to ReplicationActionForm::getDefaultTarget()
ReplicationActionForm::buildForm in src/Form/ReplicationActionForm.php
Implements buildForm().

File

src/Form/ReplicationActionForm.php, line 275

Class

ReplicationActionForm
ReplicationActionForm class.

Namespace

Drupal\deploy\Form

Code

protected function getDefaultTarget(FormStateInterface $form_state) {
  if (!empty($this->target)) {
    return $this->target;
  }
  if (!empty($this
    ->getEntity($form_state)
    ->get('target')) && $this
    ->getEntity($form_state)
    ->get('target')->entity instanceof WorkspacePointerInterface) {
    return $this->target = $this
      ->getEntity($form_state)
      ->get('target')->entity;
  }
}