1
1
<?php
2
+
2
3
declare (strict_types=1 );
3
4
4
5
namespace ImiApp \Model \Base ;
5
6
6
- use Imi \Model \Model as Model ;
7
- use Imi \Model \Annotation \DDL ;
8
- use Imi \Model \Annotation \Table ;
7
+ use Imi \Config \Annotation \ConfigValue ;
9
8
use Imi \Model \Annotation \Column ;
9
+ use Imi \Model \Annotation \DDL ;
10
10
use Imi \Model \Annotation \Entity ;
11
+ use Imi \Model \Annotation \Table ;
12
+ use Imi \Model \Model as Model ;
11
13
12
14
/**
13
- * fortune 基类
14
- * @Entity(bean=false)
15
- * @Table(name="fortune", id={"id"})
15
+ * fortune 基类.
16
+ *
17
+ * @Entity(camel=true, bean=false, incrUpdate=false)
18
+ * @Table(name=@ConfigValue(name="@app.models.ImiApp\Model\Fortune.name", default="fortune"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\Model\Fortune.poolName"))
16
19
* @DDL(sql="CREATE TABLE `fortune` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `message` varchar(2048) CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", decode="")
20
+ *
17
21
* @property int|null $id
18
22
* @property string|null $message
19
23
*/
20
24
abstract class FortuneBase extends Model
21
25
{
22
26
/**
23
- * id
24
- * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true)
27
+ * {@inheritdoc}
28
+ */
29
+ public const PRIMARY_KEY = 'id ' ;
30
+
31
+ /**
32
+ * {@inheritdoc}
33
+ */
34
+ public const PRIMARY_KEYS = ["id " ];
35
+
36
+ /**
37
+ * id.
38
+ * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
25
39
* @var int|null
26
40
*/
27
- protected ?int $ id = null ;
41
+ protected ?int $ id = NULL ;
28
42
29
43
/**
30
- * 获取 id
44
+ * 获取 id.
31
45
*
32
46
* @return int|null
33
47
*/
@@ -37,7 +51,7 @@ public function getId(): ?int
37
51
}
38
52
39
53
/**
40
- * 赋值 id
54
+ * 赋值 id.
41
55
* @param int|null $id id
42
56
* @return static
43
57
*/
@@ -48,14 +62,14 @@ public function setId($id)
48
62
}
49
63
50
64
/**
51
- * message
52
- * @Column(name="message", type="varchar", length=2048, accuracy=0, nullable=false, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
65
+ * message.
66
+ * @Column(name="message", type="varchar", length=2048, accuracy=0, nullable=false, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false )
53
67
* @var string|null
54
68
*/
55
- protected ?string $ message = null ;
69
+ protected ?string $ message = NULL ;
56
70
57
71
/**
58
- * 获取 message
72
+ * 获取 message.
59
73
*
60
74
* @return string|null
61
75
*/
@@ -65,7 +79,7 @@ public function getMessage(): ?string
65
79
}
66
80
67
81
/**
68
- * 赋值 message
82
+ * 赋值 message.
69
83
* @param string|null $message message
70
84
* @return static
71
85
*/
0 commit comments