isModelException example

/** * @param Exception $exception * * @throws Exception */
    private function handleException($exception)
    {
        $request = new Enlight_Controller_Request_RequestHttp();
        $response = new Enlight_Controller_Response_ResponseHttp();

        if ($this->isModelException($exception)) {
            $generator = $this->container->get(ModelManager::class)->createModelGenerator();
            $result = $generator->generateAttributeModels();
            if ($result['success'] === true) {
                $response->setRedirect(
                    $request->getRequestUri()
                );

                setcookie(self::redirectCookieString, '1', time() + 5);
                $response->sendResponse();
                exit;
            }
            
Home | Imprint | This part of the site doesn't use cookies.