-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtable-meta.php
More file actions
78 lines (69 loc) · 1.87 KB
/
table-meta.php
File metadata and controls
78 lines (69 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php defined( 'ABSPATH' ) || exit;
class TDB_Table_Meta {
/**
* Table key.
*
* @since 1.0.0
* @access public
* @var string $name
*/
public $name;
/**
* Table Meta database.
*
* @since 1.0.0
* @access public
* @var TDB_DataBase $db
*/
public $db;
/**
* Table Meta table object.
*
* @since 1.0.0
* @access public
* @var TDB_Table $table
*/
public $table;
/**
* TDB_Table_Meta constructor.
* @param TDB_Table $table
*/
public function __construct( $table ) {
$this->table = $table;
$this->name = $this->table->name . '_meta';
$this->db = new TDB_DataBase( $this->name, array(
'version' => 1,
'global' => $this->table->db->global,
'schema' => array(
'meta_id' => array(
'type' => 'bigint',
'length' => 20,
'unsigned' => true,
'nullable' => false,
'auto_increment' => true,
'primary_key' => true
),
$this->table->db->primary_key => array(
'type' => 'bigint',
'length' => 20,
'unsigned' => true,
'nullable' => false,
'default' => 0,
'key' => true
),
'meta_key' => array(
'type' => 'varchar',
'length' => 255,
'nullable' => true,
'default' => null,
'key' => true
),
'meta_value' => array(
'type' => 'longtext',
'nullable' => true,
'default' => null
),
)
) );
}
}