diff options
| author | polo <ordipolo@gmx.fr> | 2026-10-18 00:08:23 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-10-18 00:10:03 +0200 |
| commit | 05e38eadbeb3de19e5b26003c2b401e00bb71df4 (patch) | |
| tree | cf48350b69cfce92de6f3a0e03eb0876931c7077 /vendor/doctrine/orm/src/Mapping/DefaultNamingStrategy.php | |
| parent | 32843e50aa981f190bdb4fbc9adbeacc06fdf775 (diff) | |
| download | AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.gz AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.bz2 AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.zip | |
sortie de vendor du dépôt, oubli dans config-template.ini
Diffstat (limited to 'vendor/doctrine/orm/src/Mapping/DefaultNamingStrategy.php')
| -rw-r--r-- | vendor/doctrine/orm/src/Mapping/DefaultNamingStrategy.php | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/vendor/doctrine/orm/src/Mapping/DefaultNamingStrategy.php b/vendor/doctrine/orm/src/Mapping/DefaultNamingStrategy.php deleted file mode 100644 index 15218f9..0000000 --- a/vendor/doctrine/orm/src/Mapping/DefaultNamingStrategy.php +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Mapping; | ||
| 6 | |||
| 7 | use function str_contains; | ||
| 8 | use function strrpos; | ||
| 9 | use function strtolower; | ||
| 10 | use function substr; | ||
| 11 | |||
| 12 | /** | ||
| 13 | * The default NamingStrategy | ||
| 14 | * | ||
| 15 | * @link www.doctrine-project.org | ||
| 16 | */ | ||
| 17 | class DefaultNamingStrategy implements NamingStrategy | ||
| 18 | { | ||
| 19 | public function classToTableName(string $className): string | ||
| 20 | { | ||
| 21 | if (str_contains($className, '\\')) { | ||
| 22 | return substr($className, strrpos($className, '\\') + 1); | ||
| 23 | } | ||
| 24 | |||
| 25 | return $className; | ||
| 26 | } | ||
| 27 | |||
| 28 | public function propertyToColumnName(string $propertyName, string $className): string | ||
| 29 | { | ||
| 30 | return $propertyName; | ||
| 31 | } | ||
| 32 | |||
| 33 | public function embeddedFieldToColumnName( | ||
| 34 | string $propertyName, | ||
| 35 | string $embeddedColumnName, | ||
| 36 | string $className, | ||
| 37 | string $embeddedClassName, | ||
| 38 | ): string { | ||
| 39 | return $propertyName . '_' . $embeddedColumnName; | ||
| 40 | } | ||
| 41 | |||
| 42 | public function referenceColumnName(): string | ||
| 43 | { | ||
| 44 | return 'id'; | ||
| 45 | } | ||
| 46 | |||
| 47 | public function joinColumnName(string $propertyName, string $className): string | ||
| 48 | { | ||
| 49 | return $propertyName . '_' . $this->referenceColumnName(); | ||
| 50 | } | ||
| 51 | |||
| 52 | public function joinTableName( | ||
| 53 | string $sourceEntity, | ||
| 54 | string $targetEntity, | ||
| 55 | string $propertyName, | ||
| 56 | ): string { | ||
| 57 | return strtolower($this->classToTableName($sourceEntity) . '_' . | ||
| 58 | $this->classToTableName($targetEntity)); | ||
| 59 | } | ||
| 60 | |||
| 61 | public function joinKeyColumnName( | ||
| 62 | string $entityName, | ||
| 63 | string|null $referencedColumnName, | ||
| 64 | ): string { | ||
| 65 | return strtolower($this->classToTableName($entityName) . '_' . | ||
| 66 | ($referencedColumnName ?: $this->referenceColumnName())); | ||
| 67 | } | ||
| 68 | } | ||
