Skip to content

Commit

Permalink
Fix casting issue due to MariaDB not included in inheritance schema a…
Browse files Browse the repository at this point in the history
…nymore
  • Loading branch information
Pixelshaped committed Oct 14, 2024
1 parent c5798aa commit 50ebbab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Translatable/Query/TreeWalker/TranslationWalker.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
namespace Gedmo\Translatable\Query\TreeWalker;

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\Mapping\ClassMetadata;
Expand Down Expand Up @@ -308,9 +308,9 @@ private function prepareTranslatedComponents(): void

// Treat translation as original field type
$fieldMapping = $meta->getFieldMapping($field);
if ((($this->platform instanceof MySQLPlatform)
if ((($this->platform instanceof AbstractMySQLPlatform)
&& in_array($fieldMapping['type'], ['decimal'], true))
|| (!($this->platform instanceof MySQLPlatform)
|| (!($this->platform instanceof AbstractMySQLPlatform)
&& !in_array($fieldMapping['type'], ['datetime', 'datetimetz', 'date', 'time'], true))) {
$type = Type::getType($fieldMapping['type']);

Expand Down

0 comments on commit 50ebbab

Please sign in to comment.