You are here

public function SolrFieldTypeListBuilder::buildRow in Search API Multilingual Solr Search 8

Builds a row for an entity in the entity listing.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.

Return value

array A render array structure of fields for this entity.

Overrides EntityListBuilder::buildRow

See also

\Drupal\Core\Entity\EntityListBuilder::render()

File

src/Controller/SolrFieldTypeListBuilder.php, line 45

Class

SolrFieldTypeListBuilder
Provides a listing of SolrFieldType.

Namespace

Drupal\search_api_solr_multilingual\Controller

Code

public function buildRow(EntityInterface $solr_field_type) {

  /** @var \Drupal\search_api_solr_multilingual\SolrFieldTypeInterface $solr_field_type */
  $domains = $solr_field_type
    ->getDomains();
  if (empty($domains)) {
    $domains = [
      'generic',
    ];
  }
  $row = [
    'label' => $solr_field_type
      ->label(),
    'minimum_solr_version' => $solr_field_type
      ->getMinimumSolrVersion(),
    // @todo format
    'managed_schema' => $solr_field_type
      ->isManagedSchema(),
    // @todo format
    'langcode' => $solr_field_type
      ->getFieldTypeLanguageCode(),
    // @todo format
    'domains' => implode(', ', $domains),
    'id' => $solr_field_type
      ->id(),
  ];
  return $row + parent::buildRow($solr_field_type);
}