give-recurring-cache.php
4 years ago
give-recurring-cron.php
4 years ago
give-recurring-db-subscription-meta.php
4 years ago
give-recurring-helpers.php
4 years ago
give-recurring-subscriber.php
3 years ago
give-subscription.php
8 months ago
give-subscriptions-api.php
4 years ago
give-subscriptions-db.php
8 months ago
give-recurring-db-subscription-meta.php
76 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Subscription Meta DB class |
| 4 | * |
| 5 | * @package Give |
| 6 | * @copyright Copyright (c) 2016, GiveWP |
| 7 | * @license https://opensource.org/licenses/gpl-license GNU Public License |
| 8 | * @since 1.8 |
| 9 | */ |
| 10 | |
| 11 | // Exit if accessed directly. |
| 12 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | exit; |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * Class Give_Recurring_DB_Subscription_Meta |
| 18 | * |
| 19 | * This class is for interacting with the subscription meta database table. |
| 20 | * @since 2.19.0 - migrated from give-recurring |
| 21 | * @since 1.8 |
| 22 | */ |
| 23 | class Give_Recurring_DB_Subscription_Meta extends Give_DB_Meta { |
| 24 | |
| 25 | /** |
| 26 | * Meta supports. |
| 27 | * |
| 28 | * @since 1.8 |
| 29 | * @access protected |
| 30 | * @var array |
| 31 | */ |
| 32 | protected $supports = array(); |
| 33 | |
| 34 | /** |
| 35 | * Meta type |
| 36 | * |
| 37 | * @since 1.8 |
| 38 | * @access protected |
| 39 | * @var bool |
| 40 | */ |
| 41 | protected $meta_type = 'subscription'; |
| 42 | |
| 43 | /** |
| 44 | * Give_Recurring_DB_Subscription_Meta constructor. |
| 45 | * |
| 46 | * @access public |
| 47 | * @since 1.8 |
| 48 | */ |
| 49 | public function __construct() { |
| 50 | global $wpdb; |
| 51 | |
| 52 | $wpdb->subscriptionmeta = $this->table_name = $wpdb->prefix . 'give_subscriptionmeta'; |
| 53 | $this->primary_key = 'meta_id'; |
| 54 | $this->version = '1.0'; |
| 55 | |
| 56 | parent::__construct(); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Get table columns and data types. |
| 61 | * |
| 62 | * @access public |
| 63 | * @since 1.8 |
| 64 | * |
| 65 | * @return array Columns and formats. |
| 66 | */ |
| 67 | public function get_columns() { |
| 68 | return array( |
| 69 | 'meta_id' => '%d', |
| 70 | 'subscription_id' => '%d', |
| 71 | 'meta_key' => '%s', |
| 72 | 'meta_value' => '%s', |
| 73 | ); |
| 74 | } |
| 75 | } |
| 76 |