You are here

public function Pool::getClient in CMS Content Sync 2.1.x

Same name and namespace in other branches
  1. 8 src/Entity/Pool.php \Drupal\cms_content_sync\Entity\Pool::getClient()
  2. 2.0.x src/Entity/Pool.php \Drupal\cms_content_sync\Entity\Pool::getClient()

Parameters

mixed $fresh:

Return value

\EdgeBox\SyncCore\Interfaces\ISyncCore

File

src/Entity/Pool.php, line 116

Class

Pool
Defines the "Content Sync - Pool" entity.

Namespace

Drupal\cms_content_sync\Entity

Code

public function getClient($fresh = false) {
  if (!$this->client || $fresh) {
    if ($this
      ->useV2()) {
      $this->client = SyncCoreFactory::getSyncCoreV2();
    }
    else {
      $this->client = SyncCoreFactory::getSyncCore($this
        ->getSyncCoreUrl());
    }
  }
  return $this->client;
}