@@ -1040,6 +1040,39 @@ private function getEntityTypeHint(string $doctrineType): ?string
1040
1040
};
1041
1041
}
1042
1042
1043
+ private function getTypeConstant (string $ type ): string
1044
+ {
1045
+ $ typesMapping = [
1046
+ 'array ' => 'Types::ARRAY ' ,
1047
+ 'ascii_string ' => 'Types::ASCII_STRING ' ,
1048
+ 'bigint ' => 'Types::BIGINT ' ,
1049
+ 'binary ' => 'Types::BINARY ' ,
1050
+ 'blob ' => 'Types::BLOB ' ,
1051
+ 'boolean ' => 'Types::BOOLEAN ' ,
1052
+ 'date ' => 'Types::DATE_MUTABLE ' ,
1053
+ 'date_immutable ' => 'Types::DATE_IMMUTABLE ' ,
1054
+ 'dateinterval ' => 'Types::DATEINTERVAL ' ,
1055
+ 'datetime ' => 'Types::DATETIME_MUTABLE ' ,
1056
+ 'datetime_immutable ' => 'Types::DATETIME_IMMUTABLE ' ,
1057
+ 'datetimetz ' => 'Types::DATETIMETZ_MUTABLE ' ,
1058
+ 'datetimetz_immutable ' => 'Types::DATETIMETZ_IMMUTABLE ' ,
1059
+ 'decimal ' => 'Types::DECIMAL ' ,
1060
+ 'float ' => 'Types::FLOAT ' ,
1061
+ 'guid ' => 'Types::GUID ' ,
1062
+ 'integer ' => 'Types::INTEGER ' ,
1063
+ 'json ' => 'Types::JSON ' ,
1064
+ 'object ' => 'Types::OBJECT ' ,
1065
+ 'simple_array ' => 'Types::SIMPLE_ARRAY ' ,
1066
+ 'smallint ' => 'Types::SMALLINT ' ,
1067
+ 'string ' => 'Types::STRING ' ,
1068
+ 'text ' => 'Types::TEXT ' ,
1069
+ 'time ' => 'Types::TIME_MUTABLE ' ,
1070
+ 'time_immutable ' => 'Types::TIME_IMMUTABLE ' ,
1071
+ ];
1072
+
1073
+ return $ typesMapping [$ type ] ?? $ type ;
1074
+ }
1075
+
1043
1076
private function isInSameNamespace (string $ class ): bool
1044
1077
{
1045
1078
$ namespace = substr ($ class , 0 , strrpos ($ class , '\\' ));
0 commit comments