throwApiError::withDetails(Response::HTTP_INTERNAL_SERVER_ERROR,sprintf('attribute \'%s\' not available in source data',$sourceAttributeName));
throwApiError::withDetails(Response::HTTP_INTERNAL_SERVER_ERROR,sprintf('none of the source attributes available for local data attribute \'%s\'',$localDataAttributeName));
}
}
}
...
...
@@ -123,17 +136,23 @@ abstract class AbstractLocalDataPostEventSubscriber extends AbstractAuthorizatio
->info('The list of source attributes to map to the local data attribute ordered by preferred usage. If an attribute is not found, the next attribute in the list is used.')
->info('A boolean expression evaluable by the Symfony Expression Language determining whether the current user may request read the local data attribute.')
->info('The default value for scalar (non-array) attributes. If none is specified, an exception is thrown in the case the source attribute is not found.')
->info('The default value for scalar (i.e. non-array) attributes. If none is specified, an exception is thrown in case none of the source attributes is found.')
@@ -30,14 +30,15 @@ class LocalDataEventDispatcher
private$eventDispatcher;
/**
* @param string $resourceClass The class name of the entity (resource) this event dispatcher is responsible for
* @param EventDispatcherInterface $eventDispatcher The inner event dispatcher that this event dispatcher decorates
* @param string $resourceClass The class name of the entity (resource) this event dispatcher is responsible for
* @param EventDispatcherInterface $eventDispatcher The inner event dispatcher that this event dispatcher decorates
* @param string|null $uniqueEntityName The unique name of the entity. If not specified or empty, the 'shortName' attribute of the entities @ApiResource annotation is used.