1 | <?php |
||
5 | class DbIdentifierNameGenerator |
||
6 | { |
||
7 | /** |
||
8 | * Gets the max size of an identifier |
||
9 | * |
||
10 | * @return int |
||
11 | */ |
||
12 | public function getMaxIdentifierSize() |
||
16 | |||
17 | /** |
||
18 | * Builds an index name |
||
19 | * |
||
20 | * @param string $tableName |
||
21 | * @param string[] $columnNames |
||
22 | * @param bool $uniqueIndex |
||
23 | * @param bool $forceHash If FALSE a human readable name is generated if it is possible |
||
24 | * If TRUE a name is generated based on a hash (Doctrine standard behaviour) |
||
25 | * @return string |
||
26 | */ |
||
27 | public function generateIndexName($tableName, $columnNames, $uniqueIndex = false, $forceHash = false) |
||
37 | |||
38 | /** |
||
39 | * Builds a foreign key constraint name |
||
40 | * |
||
41 | * @param string $tableName |
||
42 | * @param string[] $columnNames |
||
43 | * @param bool $forceHash If FALSE a human readable name is generated if it is possible |
||
44 | * If TRUE a name is generated based on a hash (Doctrine standard behaviour) |
||
45 | * @return string |
||
46 | */ |
||
47 | public function generateForeignKeyConstraintName($tableName, $columnNames, $forceHash = false) |
||
57 | |||
58 | /** |
||
59 | * Generates an identifier from a list of column names obeying a certain string length. |
||
60 | * |
||
61 | * This is especially important for Oracle, since it does not allow identifiers larger than 30 chars, |
||
62 | * however building identifiers automatically for foreign keys, composite keys or such can easily create |
||
63 | * very long names. |
||
64 | * |
||
65 | * @param string|string[] $tableNames A table name or a list of table names |
||
66 | * @param string[] $columnNames |
||
67 | * @param string $prefix |
||
68 | * @param bool|null $upperCase If TRUE the returned string is in upper case; |
||
69 | * If FALSE the returned string is in lower case; |
||
70 | * If NULL the encoded name id in upper case, not encoded is in lower case |
||
71 | * @param bool $forceHash If FALSE a human readable name is generated if it is possible |
||
72 | * If TRUE a name is generated based on a hash (Doctrine standard behaviour) |
||
73 | * @return string |
||
74 | * @throws \InvalidArgumentException |
||
75 | * |
||
76 | * @SuppressWarnings(PHPMD.NPathComplexity) |
||
77 | */ |
||
78 | public function generateIdentifierName( |
||
124 | } |
||
125 |