Cml\Db\MySql\Pdo::truncate PHP Method

truncate() public method

根据表名删除数据 这个操作太危险慎用。不过一般情况程序也没这个权限
public truncate ( string $tableName ) : boolean
$tableName string 要清空的表名
return boolean
    public function truncate($tableName)
    {
        $tableName = $this->tablePrefix . $tableName;
        $stmt = $this->prepare("TRUNCATE {$tableName}");
        $this->setCacheVer($tableName);
        return $stmt->execute();
        //不存在会报错,但无关紧要
    }