You are here

private function CmisRepositoryController::initBrowser in CMIS API 8.2

Same name and namespace in other branches
  1. 8 src/Controller/CmisRepositoryController.php \Drupal\cmis\Controller\CmisRepositoryController::initBrowser()
  2. 3.0.x src/Controller/CmisRepositoryController.php \Drupal\cmis\Controller\CmisRepositoryController::initBrowser()

Init browser.

Parameters

string $config: Entity label.

string $folder_id: CMIS folder id.

array $additional_settings: Show additional_settings in field browser formatter.

Return value

array|void A renderable array in case of error.

3 calls to CmisRepositoryController::initBrowser()
CmisRepositoryController::browse in src/Controller/CmisRepositoryController.php
Browse.
CmisRepositoryController::getProperties in src/Controller/CmisRepositoryController.php
Get properties.
CmisRepositoryController::__construct in src/Controller/CmisRepositoryController.php
Construct.

File

src/Controller/CmisRepositoryController.php, line 275

Class

CmisRepositoryController
Class CmisRepositoryController.

Namespace

Drupal\cmis\Controller

Code

private function initBrowser($config, $folder_id, array $additional_settings = []) {
  \Drupal::service('cmis.connection_api')
    ->checkConnectionIsAlive($config);
  if (!empty($config)) {
    $browser = new CmisBrowser($config, $folder_id, $additional_settings);
    if ($browser
      ->getConnection()) {
      $this->browser = $browser;
    }
    else {
      return $this
        ->connectionError($config);
    }
  }
  else {
    return $this
      ->configureError();
  }
}