You are here

protected function SearchApiSolrAcquiaConnector::getEndpointUri in Acquia Search 3.x

Gets a string representation of the endpoint URI.

Could be overwritten by other connectors according to their needs.

Parameters

\Solarium\Core\Client\Endpoint $endpoint:

Return value

string

Overrides SolrConnectorPluginBase::getEndpointUri

1 call to SearchApiSolrAcquiaConnector::getEndpointUri()
SearchApiSolrAcquiaConnector::getServerUri in src/Plugin/SolrConnector/SearchApiSolrAcquiaConnector.php
Returns a the Solr server URI.

File

src/Plugin/SolrConnector/SearchApiSolrAcquiaConnector.php, line 470

Class

SearchApiSolrAcquiaConnector
Class SearchApiSolrAcquiaConnector.

Namespace

Drupal\acquia_search\Plugin\SolrConnector

Code

protected function getEndpointUri(Endpoint $endpoint) : string {
  try {
    return $endpoint
      ->getCoreBaseUri();
  } catch (UnexpectedValueException $exception) {
    $this->logger
      ->error($this
      ->t('Unavailable: @message', [
      '@message' => $exception
        ->getMessage(),
    ]));
    return $endpoint
      ->getServerUri();
  }
}