| 1 | <?php |
||
| 9 | class DefaultNamingStrategy implements NamingStrategyInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var AbstractPlatform |
||
| 13 | */ |
||
| 14 | private $platform; |
||
| 15 | |||
| 16 | public function __construct(AbstractPlatform $platform = null) |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Returns the name of the jointure table from the name of the joined tables. |
||
| 23 | * |
||
| 24 | * @param string $table1 |
||
| 25 | * @param string $table2 |
||
| 26 | * @return string |
||
| 27 | */ |
||
| 28 | public function getJointureTableName(string $table1, string $table2): string |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Returns the name of a foreign key column based on the name of the targeted table. |
||
| 35 | * |
||
| 36 | * @param string $targetTable |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | public function getForeignKeyColumnName(string $targetTable): string |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Put all the words of a string separated by underscores on singular. |
||
| 46 | * Assumes the words are in English and in their plural form. |
||
| 47 | * |
||
| 48 | * @param $plural |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | private function toSingular($plural): string |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Let's quote if a database platform has been provided to us! |
||
| 65 | * |
||
| 66 | * @param string $identifier |
||
| 67 | * @return string |
||
| 68 | */ |
||
| 69 | public function quoteIdentifier(string $identifier): string |
||
| 73 | } |
||
| 74 |