constraints
4 years ago
payer-model.php
4 years ago
payer-shipping-model.php
4 years ago
payment-meta-model.php
4 years ago
payment-model.php
4 years ago
payment-to-payer-shipping-model.php
4 years ago
payment-to-record.php
4 years ago
payment-meta-model.php
49 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Gateways\Db_Models; |
| 5 | |
| 6 | use Jet_Form_Builder\Db_Queries\Base_Db_Model; |
| 7 | use Jet_Form_Builder\Gateways\Db_Models\Constraints\Payment_Model_Constraint; |
| 8 | |
| 9 | class Payment_Meta_Model extends Base_Db_Model { |
| 10 | |
| 11 | /** |
| 12 | * @inheritDoc |
| 13 | */ |
| 14 | public static function table_name(): string { |
| 15 | return 'payments_meta'; |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * @inheritDoc |
| 20 | */ |
| 21 | public static function schema(): array { |
| 22 | return array( |
| 23 | 'id' => 'bigint(20) NOT NULL AUTO_INCREMENT', |
| 24 | 'payment_id' => 'bigint(20) NOT NULL', |
| 25 | 'meta_key' => 'varchar(255)', |
| 26 | 'meta_value' => 'text', |
| 27 | 'created_at' => 'TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP', |
| 28 | 'updated_at' => 'TIMESTAMP NOT NULL', |
| 29 | ); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * @inheritDoc |
| 34 | */ |
| 35 | public static function schema_keys(): array { |
| 36 | return array( |
| 37 | 'id' => 'primary key', |
| 38 | 'payment_id' => 'index', |
| 39 | 'meta_key' => 'index', |
| 40 | ); |
| 41 | } |
| 42 | |
| 43 | public function foreign_relations(): array { |
| 44 | return array( |
| 45 | new Payment_Model_Constraint(), |
| 46 | ); |
| 47 | } |
| 48 | } |
| 49 |