1 | <?php |
||
34 | class PrefixStripper extends Schema |
||
35 | { |
||
36 | |||
37 | private $xPrefix = ''; |
||
38 | private $xDbName = ''; |
||
39 | private $tableList = array(); |
||
40 | |||
41 | /** |
||
42 | * constructor |
||
43 | */ |
||
44 | 13 | public function __construct(array $tables=array(), array $sequences=array(), SchemaConfig $schemaConfig=null) |
|
45 | { |
||
46 | 13 | $this->xPrefix = strtolower(\XoopsBaseConfig::get('db-prefix') . '_'); |
|
47 | 13 | $this->xDbName = strtolower(\XoopsBaseConfig::get('db-name')); |
|
48 | 13 | parent::__construct($tables, $sequences, $schemaConfig); |
|
49 | 13 | } |
|
50 | |||
51 | /** |
||
52 | * set list of tables to limit schema |
||
53 | * |
||
54 | * If no list is specified, all tables will be included |
||
55 | * |
||
56 | * @param array $tableList list of tables to include |
||
57 | * |
||
58 | * @return void |
||
59 | */ |
||
60 | 2 | public function setTableFilter(array $tableList) |
|
64 | |||
65 | /** |
||
66 | * Add a table object to the schema |
||
67 | * |
||
68 | * @param Table $table table object to add |
||
69 | * |
||
70 | * @return void |
||
71 | */ |
||
72 | 1 | public function addTable(Table $table) |
|
99 | |||
100 | /** |
||
101 | * Add a sequence to the schema |
||
102 | * |
||
103 | * @param Sequence $sequence a sequence |
||
104 | * |
||
105 | * @return void |
||
106 | */ |
||
107 | 1 | public function addSequence(Sequence $sequence) |
|
118 | } |
||
119 |