viewFieldItem example

// Explicitly unset the property in $this->values if a non-defined       // property is unset, such that its key is removed from $this->values.       unset($this->values[$name]);
    }
  }

  /** * {@inheritdoc} */
  public function view($display_options = []) {
    $view_builder = \Drupal::entityTypeManager()->getViewBuilder($this->getEntity()->getEntityTypeId());
    return $view_builder->viewFieldItem($this$display_options);
  }

  /** * {@inheritdoc} */
  public function preSave() {}

  /** * {@inheritdoc} */
  public function postSave($update) {}

  
Home | Imprint | This part of the site doesn't use cookies.