Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Hook Reference
  • Docs Home

Packages

  • Deposits-for-WooCommerce
    • Bookings
    • Cart
    • Order
    • Other
    • Payment-Plans
      • Views
    • Products
    • Settings

Classes

  • DFW_Deposits
  • DFW_Deposits_For_Bookings
  • DFW_Deposits_Plan
  • DFW_Deposits_Settings
  • DFW_License
  • DFW_Manage_Cart
  • DFW_Manage_Order_Items
  • DFW_Manage_Orders
  • DFW_Manage_Plans
  • DFW_Manage_Products
  • DFW_Payment_Plans_List
  • DFW_Plans_Admin_Settings
  • DFW_Product_Admin_Settings
  • DFW_Scheduled_Plan_Orders
  • DFW_Update_DB
  • EDD_DEPOSITS_Plugin_Updater

Functions

  • dfw_update_po_file
 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 
<?php
/**
 * Alter the deposits database table in the new version
 * 
 * @author Tyche Softwares
 * @since 1.2 
 * @category Classes
 * @package Deposits-for-WooCommerce/Other
 */
class DFW_Update_DB {

    /**
     * Add a new column in the deposits table if it doesn't exist
     * 
     * @since 1.2
     */
    public static function dfw_update_plans_db() {
        global $wpdb;
        if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}dfw_deposits_payment_plans_schedule'; " ) ) {
            if ( ! $wpdb->get_var( "SHOW COLUMNS FROM {$wpdb->prefix}dfw_deposits_payment_plans_schedule LIKE 'plan_due';" ) ) {
                $wpdb->query( "ALTER TABLE {$wpdb->prefix}dfw_deposits_payment_plans_schedule ADD `plan_due` text NOT NULL AFTER `plan_amount`;" );
            }
        }
    }
}
API documentation generated by ApiGen