1 | <?php |
||
18 | class TableSchema extends AbstractTable |
||
19 | { |
||
20 | /** |
||
21 | * List of most common MySQL table engines. |
||
22 | */ |
||
23 | const ENGINE_INNODB = 'InnoDB'; |
||
24 | const ENGINE_MYISAM = 'MyISAM'; |
||
25 | const ENGINE_MEMORY = 'Memory'; |
||
26 | |||
27 | /** |
||
28 | * MySQL table engine. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | private $engine = self::ENGINE_INNODB; |
||
33 | |||
34 | /** |
||
35 | * @param Driver $driver Parent driver. |
||
36 | * @param AbstractCommander $commander |
||
37 | * @param string $name Table name, must include table prefix. |
||
38 | * @param string $prefix Database specific table prefix. |
||
39 | */ |
||
40 | public function __construct(Driver $driver, AbstractCommander $commander, $name, $prefix) |
||
50 | |||
51 | /** |
||
52 | * Change table engine. Such operation will be applied only at moment of table creation. |
||
53 | * |
||
54 | * @param string $engine |
||
55 | * @return $this |
||
56 | */ |
||
57 | public function setEngine($engine) |
||
67 | |||
68 | /** |
||
69 | * @return string |
||
70 | */ |
||
71 | public function getEngine() |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | protected function loadColumns() |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | protected function loadIndexes() |
||
116 | |||
117 | /** |
||
118 | * {@inheritdoc} |
||
119 | */ |
||
120 | protected function loadReferences() |
||
143 | |||
144 | /** |
||
145 | * {@inheritdoc} |
||
146 | */ |
||
147 | protected function columnSchema($name, $schema = null) |
||
151 | |||
152 | /** |
||
153 | * {@inheritdoc} |
||
154 | */ |
||
155 | protected function indexSchema($name, $schema = null) |
||
159 | |||
160 | /** |
||
161 | * {@inheritdoc} |
||
162 | */ |
||
163 | protected function referenceSchema($name, $schema = null) |
||
167 | } |