1 | <?php |
||
7 | class NormalistModels extends Source\AbstractSource |
||
|
|||
8 | { |
||
9 | /** |
||
10 | * Current class version |
||
11 | */ |
||
12 | const VERSION = '1.0'; |
||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | protected $model_definition; |
||
18 | |||
19 | /** |
||
20 | * @param array $model_definition |
||
21 | */ |
||
22 | 17 | public function __construct(array $model_definition) |
|
26 | |||
27 | |||
28 | /** |
||
29 | * Get unique keys on table |
||
30 | * |
||
31 | * @param string $table table name |
||
32 | * @param boolean $include_primary include primary keys in the list |
||
33 | * @throws Exception\InvalidArgumentException |
||
34 | * @throws Exception\ErrorException |
||
35 | * @throws Exception\NoPrimaryKeyException |
||
36 | * @throws Exception\ExceptionInterface |
||
37 | * @throws Exception\TableNotFoundException |
||
38 | * @return array |
||
39 | */ |
||
40 | 1 | public function getUniqueKeys($table, $include_primary = false) |
|
45 | |||
46 | |||
47 | /** |
||
48 | * Return indexes information on a table |
||
49 | * |
||
50 | * @param string $table table name |
||
51 | * @throws Exception\InvalidArgumentException |
||
52 | * @throws Exception\ErrorException |
||
53 | * @throws Exception\ExceptionInterface |
||
54 | * @throws Exception\TableNotFoundException |
||
55 | * |
||
56 | * @return array |
||
57 | */ |
||
58 | public function getIndexesInformation($table) |
||
63 | |||
64 | /** |
||
65 | * Return unique table primary key |
||
66 | * |
||
67 | * @throws Exception\InvalidArgumentException |
||
68 | * @throws Exception\ErrorException |
||
69 | * @throws Exception\NoPrimaryKeyException when no pk |
||
70 | * @throws Exception\MultiplePrimaryKeyException when multiple pk found |
||
71 | * @throws Exception\ExceptionInterface |
||
72 | * @throws Exception\TableNotFoundException |
||
73 | * |
||
74 | * @param string $table |
||
75 | * @return string|int primary key |
||
76 | */ |
||
77 | 4 | public function getPrimaryKey($table) |
|
87 | |||
88 | |||
89 | /** |
||
90 | * Return composite primary keys |
||
91 | * |
||
92 | * @throws Exception\InvalidArgumentException |
||
93 | * @throws Exception\ErrorException |
||
94 | * @throws Exception\NoPrimaryKeyException |
||
95 | * @throws Exception\ExceptionInterface |
||
96 | * @throws Exception\TableNotFoundException |
||
97 | * |
||
98 | * @param string $table |
||
99 | * @return array primary keys |
||
100 | */ |
||
101 | 6 | public function getPrimaryKeys($table) |
|
110 | |||
111 | |||
112 | /** |
||
113 | * Return column information |
||
114 | * |
||
115 | * @throws Exception\InvalidArgumentException |
||
116 | * @throws Exception\ErrorException |
||
117 | * @throws Exception\ExceptionInterface |
||
118 | * @throws Exception\TableNotFoundException |
||
119 | * |
||
120 | * @param string $table |
||
121 | * @return array associative array [column_name => infos] |
||
122 | */ |
||
123 | 1 | public function getColumnsInformation($table) |
|
128 | |||
129 | |||
130 | /** |
||
131 | * {@inheritdoc} |
||
132 | */ |
||
133 | 1 | public function getForeignKeys($table) |
|
138 | |||
139 | /** |
||
140 | * {@inheritdoc} |
||
141 | */ |
||
142 | public function getSchemaConfig() |
||
146 | |||
147 | /** |
||
148 | * {@inheritdoc} |
||
149 | */ |
||
150 | public function getReferences($table) |
||
155 | |||
156 | |||
157 | /** |
||
158 | * Return table informations |
||
159 | * |
||
160 | * @throws Exception\InvalidArgumentException |
||
161 | * @throws Exception\ErrorException |
||
162 | * @throws Exception\ExceptionInterface |
||
163 | * |
||
164 | * @return array associative array indexed by table_name |
||
165 | */ |
||
166 | 1 | public function getTablesInformation() |
|
170 | } |
||
171 |