Fall back to creating stub entity instead of just returning the plain UUID string when entity doesn't exist during param converting. This would simplify the logic a lot in each resource plugin.
So \Drupal\relaxed\ParamConverter\DbConverter::convert() \Drupal\relaxed\ParamConverter\DocIdConverter::convert() needs to change, so that we don't need all is_string() checks in the resource plugins.
Because things like this loose typing just doesn't make any sense:
/**
* @param string | \Drupal\multiversion\Entity\WorkspaceInterface $workspace
* @param string | \Drupal\Core\Entity\ContentEntityInterface $existing_entity
* @param \Drupal\Core\Entity\ContentEntityInterface $received_entity
*
* @return \Drupal\rest\ResourceResponse
*/
public function put($workspace, $existing_entity, ContentEntityInterface $received_entity) {
if (is_string($workspace)) {
throw new NotFoundHttpException();
}
// [...]
Comments
Comment #2
dixon_Comment #3
dixon_Comment #4
timmillwoodComment #6
timmillwood\Drupal\relaxed\ParamConverter\DocIdConverter::convert()still needs updating.Comment #8
jeqq commentedThis has been fixed a long time ago.