Error message

  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).

public function TranslatorListBuilder::buildRow

File

src/Entity/ListBuilder/TranslatorListBuilder.php, line 103

Class

TranslatorListBuilder
Provides a listing of translators.

Namespace

Drupal\tmgmt\Entity\ListBuilder

Code

public function buildRow(EntityInterface $entity) {
  $row['label'] = $entity
    ->label();

  // Add provider logo.

  /** @var \Drupal\tmgmt\Entity\Translator $entity */
  $definition = \Drupal::service('plugin.manager.tmgmt.translator')
    ->getDefinition($entity
    ->getPluginId());
  $npath = \Drupal::service('extension.list.module')
    ->getPath($definition['provider']);
  if (isset($definition['logo'])) {
    $logo_render_array = [
      '#theme' => 'image',
      '#uri' => \Drupal::service('file_url_generator')
        ->generateAbsoluteString($npath . '/' . $definition['logo']),
      '#alt' => $definition['label'],
      '#title' => $definition['label'],
      '#attributes' => [
        'class' => 'tmgmt-logo-overview',
      ],
    ];
  }
  $row['logo'] = isset($logo_render_array) ? $logo_render_array : [
    '#markup' => $definition['label'],
  ];
  return $row + parent::buildRow($entity);
}