public function sqlCheckIntegrity($check = true, $schema = '', $table = '')
    {
        if (empty($schema) && empty($table)) {
            return 'SET CONSTRAINTS ALL '.($check ? 'IMMEDIATE' : 'DEFERRED');
        }

        return sprintf(
                'ALTER TABLE %s.%s %s TRIGGER ALL',
                $this->getQuotedName($table),
                $this->getQuotedName($schema),
                $check ? 'ENABLE' : 'DISABLE'
            );
    }
public function sqlCheckIntegrity($check = true, $schema = '', $table = '')
    {
        if (empty($schema) && empty($table)) {
            return 'SET CONSTRAINTS ALL '.($check ? 'IMMEDIATE' : 'DEFERRED');
        }

        return sprintf(
                'ALTER TABLE %s.%s %s TRIGGER ALL',
                $this->getQuotedName($table),
                $this->getQuotedName($schema),
                $check ? 'ENABLE' : 'DISABLE'
            );
    }
public function sqlCheckIntegrity ( $ check = true , $ schema = '' , $ table = '' ) { if ( empty ( $ schema ) && empty ( $ table ) ) { return 'SET CONSTRAINTS ALL ' . ( $ check ? 'IMMEDIATE' : 'DEFERRED' ) ; } return sprintf ( 'ALTER TABLE %s.%s %s TRIGGER ALL' , $ this -> getQuotedName ( $ table ) , $ this -> getQuotedName ( $ schema ) , $ check ? 'ENABLE' : 'DISABLE' ) ; }
Builds a SQL statement for enabling or disabling integrity check.

@param bool   $check  whether to turn on or off the integrity check
@param string $schema the schema of the tables
@param string $table  the table name

@return string the SQL statement for checking integrity
Builds a SQL statement for enabling or disabling integrity check .