@@ 14-22 (lines=9) @@ | ||
11 | ||
12 | class Configuration |
|
13 | { |
|
14 | public static function register(EntityManagerInterface $em, string $keypath) |
|
15 | { |
|
16 | EncryptedColumn::create(self::buildEncryptionService($keypath)); |
|
17 | $conn = $em->getConnection(); |
|
18 | $conn->getDatabasePlatform()->registerDoctrineTypeMapping( |
|
19 | EncryptedColumn::ENCRYPTED, |
|
20 | EncryptedColumn::ENCRYPTED |
|
21 | ); |
|
22 | } |
|
23 | ||
24 | private static function buildEncryptionService(string $keypath): EncryptionService |
|
25 | { |
@@ 77-85 (lines=9) @@ | ||
74 | /** |
|
75 | * @param EntityManagerInterface $em |
|
76 | */ |
|
77 | private function doRegister(EntityManagerInterface $em) |
|
78 | { |
|
79 | EncryptedColumn::create($this->buildEncryptionService()); |
|
80 | $conn = $em->getConnection(); |
|
81 | $conn->getDatabasePlatform()->registerDoctrineTypeMapping( |
|
82 | EncryptedColumn::ENCRYPTED, |
|
83 | EncryptedColumn::ENCRYPTED |
|
84 | ); |
|
85 | } |
|
86 | ||
87 | /** |
|
88 | * @param EntityManagerInterface $em |
|
@@ 90-98 (lines=9) @@ | ||
87 | /** |
|
88 | * @param EntityManagerInterface $em |
|
89 | */ |
|
90 | private function doRegisterLegacy(EntityManagerInterface $em) |
|
91 | { |
|
92 | EncryptedColumnLegacySupport::create($this->buildEncryptionService()); |
|
93 | $conn = $em->getConnection(); |
|
94 | $conn->getDatabasePlatform()->registerDoctrineTypeMapping( |
|
95 | EncryptedColumnLegacySupport::ENCRYPTED, |
|
96 | EncryptedColumnLegacySupport::ENCRYPTED |
|
97 | ); |
|
98 | } |
|
99 | } |