Вход Регистрация
Файл: system/vendor/illuminate/database/SQLiteConnection.php
Строк: 127
<?php

namespace IlluminateDatabase;

use 
DoctrineDBALDriverPDOSqliteDriver as DoctrineDriver;
use 
IlluminateDatabaseQueryGrammarsSQLiteGrammar as QueryGrammar;
use 
IlluminateDatabaseQueryProcessorsSQLiteProcessor;
use 
IlluminateDatabaseSchemaGrammarsSQLiteGrammar as SchemaGrammar;
use 
IlluminateDatabaseSchemaSQLiteBuilder;

class 
SQLiteConnection extends Connection
{
    
/**
     * Create a new database connection instance.
     *
     * @param  PDO|Closure  $pdo
     * @param  string  $database
     * @param  string  $tablePrefix
     * @param  array  $config
     * @return void
     */
    
public function __construct($pdo$database ''$tablePrefix '', array $config = [])
    {
        
parent::__construct($pdo$database$tablePrefix$config);

        
$enableForeignKeyConstraints $this->getForeignKeyConstraintsConfigurationValue();

        if (
$enableForeignKeyConstraints === null) {
            return;
        }

        
$enableForeignKeyConstraints
            
$this->getSchemaBuilder()->enableForeignKeyConstraints()
            : 
$this->getSchemaBuilder()->disableForeignKeyConstraints();
    }

    
/**
     * Get the default query grammar instance.
     *
     * @return IlluminateDatabaseQueryGrammarsSQLiteGrammar
     */
    
protected function getDefaultQueryGrammar()
    {
        return 
$this->withTablePrefix(new QueryGrammar);
    }

    
/**
     * Get a schema builder instance for the connection.
     *
     * @return IlluminateDatabaseSchemaSQLiteBuilder
     */
    
public function getSchemaBuilder()
    {
        if (
is_null($this->schemaGrammar)) {
            
$this->useDefaultSchemaGrammar();
        }

        return new 
SQLiteBuilder($this);
    }

    
/**
     * Get the default schema grammar instance.
     *
     * @return IlluminateDatabaseSchemaGrammarsSQLiteGrammar
     */
    
protected function getDefaultSchemaGrammar()
    {
        return 
$this->withTablePrefix(new SchemaGrammar);
    }

    
/**
     * Get the default post processor instance.
     *
     * @return IlluminateDatabaseQueryProcessorsSQLiteProcessor
     */
    
protected function getDefaultPostProcessor()
    {
        return new 
SQLiteProcessor;
    }

    
/**
     * Get the Doctrine DBAL driver.
     *
     * @return DoctrineDBALDriverPDOSqliteDriver
     */
    
protected function getDoctrineDriver()
    {
        return new 
DoctrineDriver;
    }

    
/**
     * Get the database connection foreign key constraints configuration option.
     *
     * @return bool|null
     */
    
protected function getForeignKeyConstraintsConfigurationValue()
    {
        return 
$this->getConfig('foreign_key_constraints');
    }
}
Онлайн: 0
Реклама