private function ImportEntityManager::jsonErrorResponseMessage in Acquia Content Hub 8
Provides a JSON Response Message.
Parameters
string $message: The message to print.
bool $status: The status message.
int $status_code: The HTTP Status code.
Return value
\Symfony\Component\HttpFoundation\JsonResponse The JSON Response.
3 calls to ImportEntityManager::jsonErrorResponseMessage()
- ImportEntityManager::addEntityToImportQueue in src/
ImportEntityManager.php - Add the UUID to the import queue.
- ImportEntityManager::importRemoteEntity in src/
ImportEntityManager.php - Saves a Content Hub Entity into a Drupal Entity, given its UUID.
- ImportEntityManager::importRemoteEntityNoDependencies in src/
ImportEntityManager.php - Saves an Entity without taking care of dependencies.
File
- src/
ImportEntityManager.php, line 810
Class
- ImportEntityManager
- Provides a service for managing imported entities' actions.
Namespace
Drupal\acquia_contenthubCode
private function jsonErrorResponseMessage($message, $status, $status_code = 400) {
// If the Entity is not found in Content Hub then return a 404 Not Found.
$json = [
'status' => $status,
'message' => $message,
];
return new JsonResponse($json, $status_code);
}