diff options
author | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
commit | bf6655a534a6775d30cafa67bd801276bda1d98d (patch) | |
tree | c6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/doctrine/orm/src/Mapping/AnsiQuoteStrategy.php | |
parent | 94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff) | |
download | AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip |
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/doctrine/orm/src/Mapping/AnsiQuoteStrategy.php')
-rw-r--r-- | vendor/doctrine/orm/src/Mapping/AnsiQuoteStrategy.php | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Mapping/AnsiQuoteStrategy.php b/vendor/doctrine/orm/src/Mapping/AnsiQuoteStrategy.php new file mode 100644 index 0000000..872d4d6 --- /dev/null +++ b/vendor/doctrine/orm/src/Mapping/AnsiQuoteStrategy.php | |||
@@ -0,0 +1,76 @@ | |||
1 | <?php | ||
2 | |||
3 | declare(strict_types=1); | ||
4 | |||
5 | namespace Doctrine\ORM\Mapping; | ||
6 | |||
7 | use Doctrine\DBAL\Platforms\AbstractPlatform; | ||
8 | use Doctrine\ORM\Internal\SQLResultCasing; | ||
9 | |||
10 | /** | ||
11 | * ANSI compliant quote strategy, this strategy does not apply any quote. | ||
12 | * To use this strategy all mapped tables and columns should be ANSI compliant. | ||
13 | */ | ||
14 | class AnsiQuoteStrategy implements QuoteStrategy | ||
15 | { | ||
16 | use SQLResultCasing; | ||
17 | |||
18 | public function getColumnName( | ||
19 | string $fieldName, | ||
20 | ClassMetadata $class, | ||
21 | AbstractPlatform $platform, | ||
22 | ): string { | ||
23 | return $class->fieldMappings[$fieldName]->columnName; | ||
24 | } | ||
25 | |||
26 | public function getTableName(ClassMetadata $class, AbstractPlatform $platform): string | ||
27 | { | ||
28 | return $class->table['name']; | ||
29 | } | ||
30 | |||
31 | /** | ||
32 | * {@inheritDoc} | ||
33 | */ | ||
34 | public function getSequenceName(array $definition, ClassMetadata $class, AbstractPlatform $platform): string | ||
35 | { | ||
36 | return $definition['sequenceName']; | ||
37 | } | ||
38 | |||
39 | public function getJoinColumnName(JoinColumnMapping $joinColumn, ClassMetadata $class, AbstractPlatform $platform): string | ||
40 | { | ||
41 | return $joinColumn->name; | ||
42 | } | ||
43 | |||
44 | public function getReferencedJoinColumnName( | ||
45 | JoinColumnMapping $joinColumn, | ||
46 | ClassMetadata $class, | ||
47 | AbstractPlatform $platform, | ||
48 | ): string { | ||
49 | return $joinColumn->referencedColumnName; | ||
50 | } | ||
51 | |||
52 | public function getJoinTableName( | ||
53 | ManyToManyOwningSideMapping $association, | ||
54 | ClassMetadata $class, | ||
55 | AbstractPlatform $platform, | ||
56 | ): string { | ||
57 | return $association->joinTable->name; | ||
58 | } | ||
59 | |||
60 | /** | ||
61 | * {@inheritDoc} | ||
62 | */ | ||
63 | public function getIdentifierColumnNames(ClassMetadata $class, AbstractPlatform $platform): array | ||
64 | { | ||
65 | return $class->identifier; | ||
66 | } | ||
67 | |||
68 | public function getColumnAlias( | ||
69 | string $columnName, | ||
70 | int $counter, | ||
71 | AbstractPlatform $platform, | ||
72 | ClassMetadata|null $class = null, | ||
73 | ): string { | ||
74 | return $this->getSQLResultCasing($platform, $columnName . '_' . $counter); | ||
75 | } | ||
76 | } | ||