You are here

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

Returns a target object.

2 calls to ReplicationForm::getDefaultTarget()
ReplicationForm::addTitle in src/Entity/Form/ReplicationForm.php
Format the title of the Replication process.
ReplicationForm::buildForm in src/Entity/Form/ReplicationForm.php
Form constructor.

File

src/Entity/Form/ReplicationForm.php, line 249

Class

ReplicationForm
Form controller for Replication edit forms.

Namespace

Drupal\deploy\Entity\Form

Code

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

  /* @var \Drupal\multiversion\Entity\Workspace $workspace */
  $workspace = \Drupal::service('workspace.manager')
    ->getActiveWorkspace();
  return $this->target = $workspace
    ->get('upstream')->entity;
}