protected function setJsonApiRelationships(ReflectionClass $mappingClass, $mapping)
{
$mappingProperty = $mappingClass->getProperty('relationshipSelfUrl');
$mappingProperty->setAccessible(true);
$relationshipSelfUrl = (array) $mappingProperty->getValue($mapping);
if (!empty($relationshipSelfUrl)) {
foreach ($relationshipSelfUrl as &$urlMember) {
if (!empty($urlMember)) {
foreach ($urlMember as &$url) {
if (!empty($url['name'])) {
$url = $this->calculateRoute($url);
}
}
}
}
}
$mappingProperty->setValue($mapping, $relationshipSelfUrl);
}