/**
* Sets the public name of the given field on the resource type to be built.
*
* @param \Drupal\jsonapi\ResourceType\ResourceTypeField $field
* The field for which to set a public name.
* @param string $public_field_name
* The public field name to set.
*/
public function setPublicFieldName(ResourceTypeField
$field,
$public_field_name) { foreach ($this->fields
as $index =>
$value) { if ($field ===
$value) { $this->fields
[$index] =
$value->
withPublicName($public_field_name);
return;
} } } /**
* Disables the given field on the resource type to be built.
*
* @param \Drupal\jsonapi\ResourceType\ResourceTypeField $field
* The field for which to set a public name.
*/