record-action-result-model.php
2 years ago
record-error-model.php
2 years ago
record-field-model.php
2 years ago
record-model.php
2 years ago
record-action-result-model.php
55 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace JFB_Modules\Form_Record\Models; |
| 5 | |
| 6 | use JFB_Modules\Form_Record\Constraints\Record_Model_Constraint; |
| 7 | use Jet_Form_Builder\Db_Queries\Base_Db_Model; |
| 8 | use Jet_Form_Builder\Migrations\Versions\Version_2_1_0; |
| 9 | use Jet_Form_Builder\Migrations\Versions\Version_2_1_8; |
| 10 | |
| 11 | // If this file is called directly, abort. |
| 12 | if ( ! defined( 'WPINC' ) ) { |
| 13 | die; |
| 14 | } |
| 15 | |
| 16 | class Record_Action_Result_Model extends Base_Db_Model { |
| 17 | |
| 18 | public static function table_name(): string { |
| 19 | return 'records_actions'; |
| 20 | } |
| 21 | |
| 22 | public static function schema(): array { |
| 23 | return array( |
| 24 | 'id' => 'bigint(20) NOT NULL AUTO_INCREMENT', |
| 25 | 'record_id' => 'bigint(20) NOT NULL', |
| 26 | 'action_slug' => 'varchar(255) NOT NULL', |
| 27 | 'action_id' => 'int(11) NOT NULL', |
| 28 | 'on_event' => 'varchar(155) NULL DEFAULT \'DEFAULT.PROCESS\'', |
| 29 | 'status' => 'varchar(255) NOT NULL', |
| 30 | 'created_at' => 'TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP', |
| 31 | 'updated_at' => 'TIMESTAMP', |
| 32 | ); |
| 33 | } |
| 34 | |
| 35 | public static function schema_keys(): array { |
| 36 | return array( |
| 37 | 'id' => 'primary key', |
| 38 | 'record_id' => 'index', |
| 39 | ); |
| 40 | } |
| 41 | |
| 42 | public function foreign_relations(): array { |
| 43 | return array( |
| 44 | new Record_Model_Constraint(), |
| 45 | ); |
| 46 | } |
| 47 | |
| 48 | public function related_migrations(): array { |
| 49 | return array( |
| 50 | new Version_2_1_0(), |
| 51 | new Version_2_1_8(), |
| 52 | ); |
| 53 | } |
| 54 | } |
| 55 |