FortuneBase.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. declare(strict_types=1);
  3. namespace ImiApp\Model\PgSql\Base;
  4. use Imi\Pgsql\Model\PgModel as Model;
  5. use Imi\Model\Annotation\Table;
  6. use Imi\Model\Annotation\Column;
  7. use Imi\Model\Annotation\Entity;
  8. /**
  9. * Fortune 基类
  10. * @Entity(bean=false)
  11. * @Table(name="Fortune", id={"id"}, dbPoolName="pgsql")
  12. * @property int|null $id
  13. * @property string|null $message
  14. */
  15. abstract class FortuneBase extends Model
  16. {
  17. /**
  18. * id
  19. * @Column(name="id", type="int4", length=-1, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=1, isAutoIncrement=false, ndims=0)
  20. * @var int|null
  21. */
  22. protected ?int $id = null;
  23. /**
  24. * 获取 id
  25. *
  26. * @return int|null
  27. */
  28. public function getId(): ?int
  29. {
  30. return $this->id;
  31. }
  32. /**
  33. * 赋值 id
  34. * @param int|null $id id
  35. * @return static
  36. */
  37. public function setId(?int $id)
  38. {
  39. $this->id = $id;
  40. return $this;
  41. }
  42. /**
  43. * message
  44. * @Column(name="message", type="varchar", length=0, accuracy=2048, nullable=false, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, ndims=0)
  45. * @var string|null
  46. */
  47. protected ?string $message = null;
  48. /**
  49. * 获取 message
  50. *
  51. * @return string|null
  52. */
  53. public function getMessage(): ?string
  54. {
  55. return $this->message;
  56. }
  57. /**
  58. * 赋值 message
  59. * @param string|null $message message
  60. * @return static
  61. */
  62. public function setMessage(?string $message)
  63. {
  64. $this->message = $message;
  65. return $this;
  66. }
  67. }