1 | <?php |
||
16 | class TDBMSchemaAnalyzer |
||
17 | { |
||
18 | |||
19 | private $connection; |
||
20 | |||
21 | /** |
||
22 | * @var Schema |
||
23 | */ |
||
24 | private $schema; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $cachePrefix; |
||
30 | |||
31 | /** |
||
32 | * @var Cache |
||
33 | */ |
||
34 | private $cache; |
||
35 | |||
36 | /** |
||
37 | * @var SchemaAnalyzer |
||
38 | */ |
||
39 | private $schemaAnalyzer; |
||
40 | |||
41 | /** |
||
42 | * @param Connection $connection The DBAL DB connection to use |
||
43 | * @param Cache $cache A cache service to be used |
||
44 | * @param SchemaAnalyzer $schemaAnalyzer The schema analyzer that will be used to find shortest paths... |
||
45 | * Will be automatically created if not passed. |
||
46 | */ |
||
47 | public function __construct(Connection $connection, Cache $cache, SchemaAnalyzer $schemaAnalyzer) { |
||
52 | |||
53 | /** |
||
54 | * Returns a unique ID for the current connection. Useful for namespacing cache entries in the current connection. |
||
55 | * @return string |
||
56 | */ |
||
57 | public function getCachePrefix() { |
||
63 | |||
64 | /** |
||
65 | * Returns the (cached) schema. |
||
66 | * |
||
67 | * @return Schema |
||
68 | */ |
||
69 | public function getSchema() { |
||
81 | |||
82 | /** |
||
83 | * Returns the list of pivot tables linked to table $tableName |
||
84 | * @param string $tableName |
||
85 | * @return array|string[] |
||
86 | */ |
||
87 | public function getPivotTableLinkedToTable($tableName) { |
||
109 | |||
110 | /** |
||
111 | * Returns the list of foreign keys pointing to the table represented by this bean, excluding foreign keys |
||
112 | * from junction tables and from inheritance. |
||
113 | * |
||
114 | * @return ForeignKeyConstraint[] |
||
115 | */ |
||
116 | public function getIncomingForeignKeys($tableName) { |
||
141 | } |
||
142 |