CI_DB_query_builder::truncate PHP Method

truncate() public method

Compiles a truncate string and runs the query If the database does not support the truncate() command This function maps to "DELETE FROM table"
public truncate ( $table = '' ) : boolean
return boolean TRUE on success, FALSE on failure
    public function truncate($table = '')
    {
        if ($table === '') {
            if (!isset($this->qb_from[0])) {
                return $this->db_debug ? $this->display_error('db_must_set_table') : FALSE;
            }
            $table = $this->qb_from[0];
        } else {
            $table = $this->protect_identifiers($table, TRUE, NULL, FALSE);
        }
        $sql = $this->_truncate($table);
        $this->_reset_write();
        return $this->query($sql);
    }