getLabelFieldName example


  protected function setEntity(EntityInterface $entity) {
    $this->entity = $entity;
  }

  /** * {@inheritdoc} */
  protected static function extractFieldsFromEntity(ResourceType $resource_type, EntityInterface $entity) {
    $fields = parent::extractFieldsFromEntity($resource_type$entity);
    $public_label_field_name = $resource_type->getPublicName(static::getLabelFieldName($entity));
    return array_intersect_key($fields[$public_label_field_name => TRUE]);
  }

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