public static function createFromEntity(ResourceType
$resource_type, EntityInterface
$entity, LinkCollection
$links = NULL
) { return new static( $entity,
$resource_type,
$entity->
uuid(),
$resource_type->
isVersionable() &&
$entity instanceof RevisionableInterface ?
$entity->
getRevisionId() : NULL,
static::
extractFieldsFromEntity($resource_type,
$entity),
static::
buildLinksFromEntity($resource_type,
$entity,
$links ?:
new LinkCollection([])),
$entity->
language() );
} /**
* Whether the resource object has the given field.
*
* @param string $public_field_name
* A public field name.
*
* @return bool
* TRUE if the resource object has the given field, FALSE otherwise.
*/