WorldBase.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. * World 基类
  10. * @Entity(bean=false)
  11. * @Table(name="World", id={"id"}, dbPoolName="pgsql")
  12. * @property int|null $id
  13. * @property int|null $randomnumber
  14. */
  15. abstract class WorldBase 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. * randomnumber
  44. * @Column(name="randomnumber", type="int4", length=-1, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, ndims=0)
  45. * @var int|null
  46. */
  47. protected ?int $randomnumber = null;
  48. /**
  49. * 获取 randomnumber
  50. *
  51. * @return int|null
  52. */
  53. public function getRandomnumber(): ?int
  54. {
  55. return $this->randomnumber;
  56. }
  57. /**
  58. * 赋值 randomnumber
  59. * @param int|null $randomnumber randomnumber
  60. * @return static
  61. */
  62. public function setRandomnumber(?int $randomnumber)
  63. {
  64. $this->randomnumber = $randomnumber;
  65. return $this;
  66. }
  67. }