admin
7 years ago
api
7 years ago
deprecated
7 years ago
donors
7 years ago
emails
7 years ago
forms
7 years ago
gateways
7 years ago
libraries
7 years ago
payments
7 years ago
actions.php
7 years ago
ajax-functions.php
7 years ago
class-give-async-process.php
8 years ago
class-give-background-updater.php
7 years ago
class-give-cache.php
7 years ago
class-give-cli-commands.php
8 years ago
class-give-comment.php
7 years ago
class-give-cron.php
8 years ago
class-give-db-donor-meta.php
8 years ago
class-give-db-donors.php
7 years ago
class-give-db-form-meta.php
8 years ago
class-give-db-logs-meta.php
8 years ago
class-give-db-logs.php
7 years ago
class-give-db-meta.php
7 years ago
class-give-db-payment-meta.php
7 years ago
class-give-db-sequential-ordering.php
7 years ago
class-give-db-sessions.php
7 years ago
class-give-db.php
8 years ago
class-give-donate-form.php
8 years ago
class-give-donor-wall-widget.php
7 years ago
class-give-donor.php
7 years ago
class-give-email-access.php
8 years ago
class-give-html-elements.php
7 years ago
class-give-license-handler.php
7 years ago
class-give-logging.php
8 years ago
class-give-readme-parser.php
8 years ago
class-give-roles.php
8 years ago
class-give-scripts.php
7 years ago
class-give-session.php
7 years ago
class-give-stats.php
8 years ago
class-give-template-loader.php
8 years ago
class-give-tooltips.php
8 years ago
class-give-translation.php
8 years ago
class-notices.php
7 years ago
country-functions.php
8 years ago
currency-functions.php
7 years ago
error-tracking.php
8 years ago
filters.php
7 years ago
formatting.php
7 years ago
import-functions.php
7 years ago
install.php
7 years ago
login-register.php
8 years ago
misc-functions.php
7 years ago
plugin-compatibility.php
8 years ago
post-types.php
8 years ago
price-functions.php
7 years ago
process-donation.php
7 years ago
shortcodes.php
7 years ago
template-functions.php
8 years ago
user-functions.php
7 years ago
class-give-db-form-meta.php
90 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Form Meta DB class |
| 4 | * |
| 5 | * @package Give |
| 6 | * @subpackage Classes/DB Form Meta |
| 7 | * @copyright Copyright (c) 2016, WordImpress |
| 8 | * @license https://opensource.org/licenses/gpl-license GNU Public License |
| 9 | * @since 2.0 |
| 10 | */ |
| 11 | |
| 12 | // Exit if accessed directly. |
| 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | exit; |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * Class Give_DB_Form_Meta |
| 19 | * |
| 20 | * This class is for interacting with the form meta database table. |
| 21 | * |
| 22 | * @since 2.0 |
| 23 | */ |
| 24 | class Give_DB_Form_Meta extends Give_DB_Meta { |
| 25 | /** |
| 26 | * Post type |
| 27 | * |
| 28 | * @since 2.0 |
| 29 | * @access protected |
| 30 | * @var bool |
| 31 | */ |
| 32 | protected $post_type = 'give_forms'; |
| 33 | |
| 34 | /** |
| 35 | * Meta type |
| 36 | * |
| 37 | * @since 2.0 |
| 38 | * @access protected |
| 39 | * @var bool |
| 40 | */ |
| 41 | protected $meta_type = 'form'; |
| 42 | |
| 43 | /** |
| 44 | * Give_DB_Form_Meta constructor. |
| 45 | * |
| 46 | * @access public |
| 47 | * @since 2.0 |
| 48 | */ |
| 49 | public function __construct() { |
| 50 | /* @var WPDB $wpdb */ |
| 51 | global $wpdb; |
| 52 | |
| 53 | $wpdb->formmeta = $this->table_name = $wpdb->prefix . 'give_formmeta'; |
| 54 | $this->primary_key = 'meta_id'; |
| 55 | $this->version = '1.0'; |
| 56 | |
| 57 | $this->register_table(); |
| 58 | |
| 59 | parent::__construct(); |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Get table columns and data types. |
| 64 | * |
| 65 | * @access public |
| 66 | * @since 2.0 |
| 67 | * |
| 68 | * @return array Columns and formats. |
| 69 | */ |
| 70 | public function get_columns() { |
| 71 | return array( |
| 72 | 'meta_id' => '%d', |
| 73 | 'form_id' => '%d', |
| 74 | 'meta_key' => '%s', |
| 75 | 'meta_value' => '%s', |
| 76 | ); |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * check if custom meta table enabled or not. |
| 81 | * |
| 82 | * @since 2.0 |
| 83 | * @access protected |
| 84 | * @return bool |
| 85 | */ |
| 86 | protected function is_custom_meta_table_active() { |
| 87 | return give_has_upgrade_completed( 'v20_move_metadata_into_new_table' ); |
| 88 | } |
| 89 | } |
| 90 |