File tree Expand file tree Collapse file tree 1 file changed +82
-0
lines changed Expand file tree Collapse file tree 1 file changed +82
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Eghamat24 \DatabaseRepository \Models \Enums ;
4
+
5
+ enum DataTypeEnum
6
+ {
7
+ public const INTEGER_TYPE = 'int ' ;
8
+ public const BOOLEAN_TYPE = 'bool ' ;
9
+ public const FLOAT_TYPE = 'float ' ;
10
+ public const STRING_TYPE = 'string ' ;
11
+
12
+
13
+ case BOOL ;
14
+ case BOOLEAN ;
15
+ case BIT ;
16
+ case INT ;
17
+ case INTEGER ;
18
+ case TINYINT ;
19
+ case SMALLINT ;
20
+ case MEDIUMINT ;
21
+ case BIGINT ;
22
+ case FLOAT ;
23
+ case DOUBLE ;
24
+ case JSON ;
25
+ case CHAR ;
26
+ case VARCHAR ;
27
+ case BINARY ;
28
+ case VARBINARY ;
29
+ case TINYBLOB ;
30
+ case TINYTEXT ;
31
+ case TEXT ;
32
+ case BLOB ;
33
+ case MEDIUMTEXT ;
34
+ case MEDIUMBLOB ;
35
+ case LONGTEXT ;
36
+ case LONGBLOB ;
37
+ case ENUM ;
38
+ case DATE ;
39
+ case TIME ;
40
+ case DATETIME ;
41
+ case TIMESTAMP ;
42
+ case POINT ;
43
+
44
+ public function matchingType (): string
45
+ {
46
+ return match ($ this ) {
47
+ self ::BOOL ,
48
+ self ::BOOLEAN => self ::BOOLEAN_TYPE ,
49
+
50
+ self ::BIT ,
51
+ self ::JSON ,
52
+ self ::CHAR ,
53
+ self ::VARCHAR ,
54
+ self ::BINARY ,
55
+ self ::VARBINARY ,
56
+ self ::DATETIME ,
57
+ self ::TIME ,
58
+ self ::DATE ,
59
+ self ::ENUM ,
60
+ self ::LONGBLOB ,
61
+ self ::LONGTEXT ,
62
+ self ::MEDIUMBLOB ,
63
+ self ::MEDIUMTEXT ,
64
+ self ::BLOB ,
65
+ self ::TEXT ,
66
+ self ::TINYTEXT ,
67
+ self ::TINYBLOB ,
68
+ self ::TIMESTAMP ,
69
+ self ::POINT => self ::STRING_TYPE ,
70
+
71
+ self ::INT ,
72
+ self ::INTEGER ,
73
+ self ::TINYINT ,
74
+ self ::SMALLINT ,
75
+ self ::MEDIUMINT ,
76
+ self ::BIGINT => self ::INTEGER_TYPE ,
77
+
78
+ self ::FLOAT ,
79
+ self ::DOUBLE => self ::FLOAT_TYPE ,
80
+ };
81
+ }
82
+ }
You can’t perform that action at this time.
0 commit comments