createModelGenerator example


    public function validate($object)
    {
        return $this->getValidator()->validate($object);
    }

    /** * @param string[] $tableNames */
    public function generateAttributeModels($tableNames = [])
    {
        $generator = $this->createModelGenerator();
        $generator->generateAttributeModels($tableNames);

        $this->regenerateAttributeProxies($tableNames);
    }

    /** * Generates Doctrine proxy classes * * @param string[] $tableNames */
    public function regenerateAttributeProxies($tableNames = [])
    {
/** * @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;
            }
            exit(sprintf("Failed to create the attribute models, please check the permissions of the '%s' directory", $generator->getPath()));
        }
Home | Imprint | This part of the site doesn't use cookies.