1 | <?php |
||
15 | class TDBMSchemaAnalyzer |
||
16 | { |
||
17 | private $connection; |
||
18 | |||
19 | /** |
||
20 | * @var Schema |
||
21 | */ |
||
22 | private $schema; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $cachePrefix; |
||
28 | |||
29 | /** |
||
30 | * @var Cache |
||
31 | */ |
||
32 | private $cache; |
||
33 | |||
34 | /** |
||
35 | * @var SchemaAnalyzer |
||
36 | */ |
||
37 | private $schemaAnalyzer; |
||
38 | |||
39 | /** |
||
40 | * @param Connection $connection The DBAL DB connection to use |
||
41 | * @param Cache $cache A cache service to be used |
||
42 | * @param SchemaAnalyzer $schemaAnalyzer The schema analyzer that will be used to find shortest paths... |
||
43 | * Will be automatically created if not passed. |
||
44 | */ |
||
45 | public function __construct(Connection $connection, Cache $cache, SchemaAnalyzer $schemaAnalyzer) |
||
51 | |||
52 | /** |
||
53 | * Returns a unique ID for the current connection. Useful for namespacing cache entries in the current connection. |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | public function getCachePrefix() |
||
65 | |||
66 | /** |
||
67 | * Returns the (cached) schema. |
||
68 | * |
||
69 | * @return Schema |
||
70 | */ |
||
71 | public function getSchema() |
||
85 | |||
86 | /** |
||
87 | * Returns the list of pivot tables linked to table $tableName. |
||
88 | * |
||
89 | * @param string $tableName |
||
90 | * |
||
91 | * @return array|string[] |
||
92 | */ |
||
93 | public function getPivotTableLinkedToTable($tableName) |
||
117 | |||
118 | /** |
||
119 | * Returns the list of foreign keys pointing to the table represented by this bean, excluding foreign keys |
||
120 | * from junction tables and from inheritance. |
||
121 | * |
||
122 | * @return ForeignKeyConstraint[] |
||
123 | */ |
||
124 | public function getIncomingForeignKeys($tableName) |
||
149 | } |
||
150 |