{@inheritdoc}

@throws \Fridge\DBAL\Exception\PlatformException If the platform does not support view.
779131
public function getCreateViewSQLQueries(View $view)
    {
        if (!$this->supportViews()) {
            throw PlatformException::methodNotSupported(__METHOD__);
        }

        return array('CREATE VIEW '.$view->getName().' AS '.$view->getSQL());
    }
442449
public function view($___view, $___variables = null, $___realpath = false)
    {
        $___file = BASEPATH.'/App/Views/' . ($___realpath ? $___view : $___view . '.tpl.php');
        if (!file_exists($___file)) {
            throw new \Exception("View not found ! File : {$___view}", 400);
        }
        if (is_array($___variables)) {
            foreach ($___variables as $___key => $___value) {
                $$___key = $___value;
            }
        }
        unset($___variables, $___key, $___value, $___realpath, $___view);
        include $___file;
    }
1343103
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if (empty($value)) {
            return null;
        }

        if (
            $value instanceof UuidInterface
            || (
                (is_string($value) || method_exists($value, '__toString'))
                && Uuid::isValid((string) $value)
            )
        ) {
            return (string) $value;
        }

        throw ConversionException::conversionFailed($value, static::NAME);
    }
735806
private function getPlatformProvider($platform=[], EventManager $eventManager)
	{	
		if (is_null($platform)) {
			return false;
		}

		$platformId = key($platform);
		$platform = current($platform);
		if (!isset($platform['provider'])) {
			$this->connectionFailed = ':noPlatform';
			return false;
		}

		$provider = $platform['provider'];
		if (!class_exists($provider)) {
			$this->connectionFailed = ':noConnectorProvider';
			return false;
		}

		$this->preparedConnection = $platform;
		$platformProvider = new $provider($this, new EventManager());
		if (!$platformProvider instanceof PlatformProvider) {
			return false;
		}

		if (isset($platform['domain']) && !Domain::matches($platform['domain'])) {
			$eventManager->dispatchEvent('domain.notallowed', [$platformId => $platform]);
			return false;
		}

		$this->platformProvider = $platformProvider;
		$providerConnector = $this->platformProvider;
		return $providerConnector;
	}
760058
public function convertToDatabaseValue($value, AbstractPlatform $platform)
     {
         if ($value === null) {
             return;
         }
         $formatString = $platform->getDateTimeFormatString();

         $formatted = $value->setTimezone(new \DateTimeZone('UTC'))->format($formatString);

         return $formatted;
     }
1258181
public function setPlatform($platform, $relationship = null)
    {
        $this->validateInput(
            $platform,
            $this->validator,
            'validatePlatform',
            $this->exception,
            'Provided platform is not a valid value.'
        );

        self::$xml['platform'] = '<video:platform';
        $this->setPlatformRelationship($relationship);
        self::$xml['platform'] .= '>'.$platform.'</video:platform>';

        return $this;
    }
260069
public function addCustomType($type)
    {
        if (!Type::hasType($type)) {
            throw TypeException::typeDoesNotExist($type);
        }

        if ($this->hasCustomType($type)) {
            throw PlatformException::customTypeAlreadyExists($type);
        }

        $this->customTypes[] = $type;
    }
1309339
public final function view(string $file, array $content = null, bool $useViewPartials = null): void
    {
        if (!$this->useView) {
            throw new ServiceException("Set \$useView = true in service and be sure that already ".
                "included 'froq/froq-view' module via Composer");
        }

        $data = (array) ($content['data'] ?? []);
        $meta = (array) ($content['meta'] ?? []);

        // set meta if provided
        if ($meta != null) {
            foreach ($meta as $name => $value) {
                $this->view->setMeta($name, $value);
            }
        }

        $this->view->setFile($file);

        // override on runtime calls
        $useViewPartials = $useViewPartials ?? $this->useViewPartials;

        // set header/footer partials if uses
        if ($useViewPartials) {
            $this->view->setFileHead();
            $this->view->setFileFoot();
        }

        $this->view->display($data);
    }
629016
public function getPlatform()
    {
        if (null === $this->platform) {
            $this->platform = new SqlitePlatform();
        }

        $this->platform->setIdentifierQuoting($this->identifierQuoting);

        return $this->platform;
    }
1248145
public function use_view($view)
	{
		$views = call_user_func(array($this->model, 'views'));
		if ( ! array_key_exists($view, $views))
		{
			throw new \OutOfBoundsException('Cannot use undefined database view, must be defined with Model.');
		}

		$this->view = $views[$view];
		$this->view['_name'] = $view;
		return $this;
	}
132623
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if ($value === null) {
            return $value;
        }

        if (! ($value instanceof GeometryInterface)) {
            throw new InvalidValueException('Geometry column values must implement GeometryInterface');
        }

        return $this->getSpatialPlatform($platform)->convertToDatabaseValue($this, $value);
    }
839926
public function process()
	{
		$view = $this->getView();
		$context = $this->_getContext();

		try
		{
			parent::process();
		}
		catch( Client_Html_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'client/html', $e->getMessage() ) );
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
		}
		catch( Controller_Frontend_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
		}
		catch( MShop_Plugin_Provider_Exception $e )
		{
			$errors = array( $this->_getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$errors = array_merge( $errors, $this->_translatePluginErrorCodes( $e->getErrorCodes() ) );

			$view->summaryErrorCodes = $e->getErrorCodes();
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $errors;
		}
		catch( MShop_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
		}
		catch( Exception $e )
		{
			$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );

			$error = array( $context->getI18n()->dt( 'client/html', 'A non-recoverable error occured' ) );
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
		}
	}
558519
public function getPlatform()
    {
        switch ($this->getDriver()) {
            case 'pdo_mysql':
                return new Platform\Mysql();
                break;

            case 'pdo_pgsql':
                return new Platform\Postgresql();
                break;

            case 'pdo_sqlite':
                return new Platform\Sqlite();
                break;

            case 'pdo_sqlsrv':
                return new Platform\SqlServer();
                break;

            default:

                throw new \Exception(sprintf('Unknown platform %s.', $this->getPlatform()));
                break;
        }
    }
283821
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if ($value === null) {
            return;
        }

        $formatter = new \NumberFormatter('pt_BR', \NumberFormatter::DECIMAL);
        $formatted = $formatter->parse($value);

        return $formatted;
    }
164429
public static function setViewContext($context = null)
    {
        if ($context === null) {
            $context = self::get(self::get('app.views.context_param', 'format'), 
                                self::get('app.views.default_context', 'html'), 
                                self::get('request'));
        }
        
        self::set('app.view_context', $context);
        
        if (($viewContextParams = self::get("app.views.contexts.$context", false)) !== false) {
            if ($viewContextParams['layout'] !== true) {
                self::set('app.layout', $viewContextParams['layout']);
            }
            header('Content-type: ' . 
                self::get('content_type', 'text/html', $viewContextParams));
        }
    }
1350406
public function findView($view)
    {
        $file = $this->basePath("app/View/$view.php");
        if($this->findFile($file)) {
            return $file;
        }
        else {
            throw new Exception($file." View file is missing.");
            exit;
        }
    }
1164914
protected function resolveView()
    {
        $view = new SimpleTemplateView(['templateSource' => file_get_contents(FLOW_PATH_FLOW . 'Resources/Private/Mvc/StandardView_Template.html')]);
        $view->setControllerContext($this->controllerContext);
        return $view;
    }