public function checkElementKey(ServerRequest $request, Response $response): Response
    {
        $elementKey = $request->getQueryParams()['key'];

        $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
        $storageRepository = $objectManager->get(StorageRepository::class);

        $isAvailable = true;
        if ($storageRepository->loadElement('tt_content', $elementKey)) {
            $isAvailable = false;
        }

        return new JsonResponse(['isAvailable' => $isAvailable]);
    }
public function checkElementKey(ServerRequest $request, Response $response): Response
    {
        $elementKey = $request->getQueryParams()['key'];

        $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
        $storageRepository = $objectManager->get(StorageRepository::class);

        $isAvailable = true;
        if ($storageRepository->loadElement('tt_content', $elementKey)) {
            $isAvailable = false;
        }

        return new JsonResponse(['isAvailable' => $isAvailable]);
    }
public function checkElementKey ( ServerRequest $ request , Response $ response ) : Response { $ elementKey = $ request -> getQueryParams ( ) [ 'key' ] ; $ objectManager = GeneralUtility :: makeInstance ( ObjectManager :: class ) ; $ storageRepository = $ objectManager -> get ( StorageRepository :: class ) ; $ isAvailable = true ; if ( $ storageRepository -> loadElement ( 'tt_content' , $ elementKey ) ) { $ isAvailable = false ; } return new JsonResponse ( [ 'isAvailable' => $ isAvailable ] ) ; }
Checks if a key for an element is available
Checks if a key for an element is available