-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Labels
Milestone
Description
This:
/**
* @param SystemVersion $record
* @return iterable
*/
protected function existingRelationships($record): iterable
{
return [
'product-version' => [
'data' => [
'type' => 'product-versions',
'id' => (string) $record->productVersion->getRouteKey(),
],
],
'system' => [
'data' => [
'type' => 'systems',
'id' => (string) $record->system->getRouteKey(),
],
],
];
}Could be simplified to this:
/**
* @param SystemVersion $record
* @return iterable
*/
protected function existingRelationships($record): iterable
{
return [
'product-version' => $record->productVersion,
'system' => $record->system,
];
}If the abstract validators class converted objects and null values to a JSON API data array. Would need to support iterables as well (i.e. collections).
Can be implemented in a backwards compatible way if we detect arrays with a data key.