Phalcon\Test\ModelTestCase::truncateTable PHP Method

truncateTable() public method

Disables FOREIGN_KEY_CHECKS and truncates database table
public truncateTable ( string $table ) : boolean
$table string table name
return boolean result of truncate operation
    public function truncateTable($table)
    {
        /* @var $db \Phalcon\Db\Adapter\Pdo\Mysql */
        $db = $this->getDI()->get('db');
        $db->execute("SET FOREIGN_KEY_CHECKS = 0");
        $success = $db->execute("TRUNCATE TABLE `{$table}`");
        $db->execute("SET FOREIGN_KEY_CHECKS = 1");
        return $success;
    }