renderByRelationship example

if ($entity = $this->getEntity($row$relationship)) {
        $entity->view = $this->view;
        $this->build[$entity->id()] = $view_builder->view($entity$this->view->rowPlugin->options['view_mode']$this->getLangcodeByRelationship($row$relationship));
      }
    }
  }

  /** * {@inheritdoc} */
  public function render(ResultRow $row) {
    return $this->renderByRelationship($row, 'none');
  }

  /** * Renders entity data. * * @param \Drupal\views\ResultRow $row * A single row of the query result. * @param string $relationship * The relationship to be used. * * @return array * A renderable array for the entity data contained in the result row. */
public function preRender($result) {
    parent::preRender($result);
    if ($result) {
      $this->getEntityTranslationRenderer()->preRenderByRelationship($resultisset($this->options['relationship']) ? $this->options['relationship'] : 'none');
    }
  }

  /** * {@inheritdoc} */
  public function render($row) {
    return $this->getEntityTranslationRenderer()->renderByRelationship($rowisset($this->options['relationship']) ? $this->options['relationship'] : 'none');
  }

  /** * {@inheritdoc} */
  public function calculateDependencies() {
    $dependencies = parent::calculateDependencies();

    $view_mode = $this->entityTypeManager
      ->getStorage('entity_view_mode')
      ->load($this->entityTypeId . '.' . $this->options['view_mode']);
    
Home | Imprint | This part of the site doesn't use cookies.