SearchApiSolrConflictingEntitiesException.php in Search API Solr 4.x
File
src/SearchApiSolrConflictingEntitiesException.php
View source
<?php
namespace Drupal\search_api_solr;
use Drupal\Component\Render\FormattableMarkup;
class SearchApiSolrConflictingEntitiesException extends SearchApiSolrException {
protected $conflictingEntities = [];
public function getConflictingEntities() : array {
return $this->conflictingEntities;
}
public function setConflictingEntities(array $conflictingEntities) : void {
$this->conflictingEntities = $conflictingEntities;
}
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>';
}
}