You are here

public function SearchApiSolrConflictingEntitiesException::__toString in Search API Solr 8.3

Same name and namespace in other branches
  1. 4.x src/SearchApiSolrConflictingEntitiesException.php \Drupal\search_api_solr\SearchApiSolrConflictingEntitiesException::__toString()

File

src/SearchApiSolrConflictingEntitiesException.php, line 42

Class

SearchApiSolrConflictingEntitiesException
Represents an exception that occurs in Search API Solr.

Namespace

Drupal\search_api_solr

Code

public function __toString() {
  $conflicts = '<ul>';
  foreach ($this
    ->getConflictingEntities() as $entity) {
    $link = new FormattableMarkup('<li><a href="' . $entity
      ->toUrl('collection')
      ->toString() . '">@label</a></li>', [
      '@label' => $entity
        ->label(),
    ]);
    $conflicts .= $link;
  }
  return $conflicts . '</ul>';
}