core-post-model.php
53 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Db_Queries\Models; |
| 5 | |
| 6 | use Jet_Form_Builder\Db_Queries\Base_Db_Model; |
| 7 | |
| 8 | // If this file is called directly, abort. |
| 9 | if ( ! defined( 'WPINC' ) ) { |
| 10 | die; |
| 11 | } |
| 12 | |
| 13 | class Core_Post_Model extends Base_Db_Model { |
| 14 | |
| 15 | public static function table() { |
| 16 | global $wpdb; |
| 17 | |
| 18 | return $wpdb->posts; |
| 19 | } |
| 20 | |
| 21 | public function create(): Base_Db_Model { |
| 22 | return $this; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Returns table name |
| 27 | * |
| 28 | * @return [type] [description] |
| 29 | */ |
| 30 | public static function table_name(): string { |
| 31 | return 'posts'; |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Returns columns schema |
| 36 | * |
| 37 | * @return [type] [description] |
| 38 | */ |
| 39 | public static function schema(): array { |
| 40 | return array(); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Returns schemas options |
| 45 | * Such as primary keys, charset |
| 46 | * |
| 47 | * @return [type] [description] |
| 48 | */ |
| 49 | public static function schema_keys(): array { |
| 50 | return array(); |
| 51 | } |
| 52 | } |
| 53 |