CodeExplorer serializeRelationships example
{ return;
} $self =
$result->
getBaseUrl() . '/' .
$this->
camelCaseToSnailCase($definition->
getEntityName()) . '/' .
$entity->
getUniqueIdentifier();
$serialized =
clone $this->
createSerializedEntity($fields,
$definition,
$result);
$serialized->
addLink('self',
$self);
$serialized->
merge($entity);
// add included entities
$this->
serializeRelationships($fields,
$serialized,
$entity,
$result);
$this->
addExtensions($fields,
$serialized,
$entity,
$result);
if ($isRelationship) { $result->
addIncluded($serialized);
} else { $result->
addEntity($serialized);
} } protected function serializeRelationships(ResponseFields
$fields, Record
$record, Entity
$entity, JsonApiEncodingResult
$result): void
{