src/Entity/Person/Person.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Person;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Uid\Uuid;
  5. use App\Entity\World;
  6. #[ORM\Entity]
  7. #[ORM\Table(name'persons')]
  8. class Person
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\Column(type'uuid'uniquetrue)]
  12.     private $id;
  13.     
  14.     public function __construct()
  15.     {
  16.         $this->id Uuid::v4();
  17.     }
  18.     #[ORM\Column(type'string'length255)]
  19.     private $name;
  20.     #[ORM\Column(type'string'length255)]
  21.     private $health;
  22.     #[ORM\Column(type'integer')]
  23.     private $money;
  24.     #[ORM\Column(type'string'length255)]
  25.     private $spec;
  26.     #[ORM\ManyToOne(targetEntityWorld::class)]
  27.     #[ORM\JoinColumn(nullablefalse)]
  28.     private $world;
  29.     #[ORM\Column(type'text'nullablefalseoptions: ['default' => ''])]
  30.     private string $description '';
  31.     // Getters and setters
  32.     public function getId(): ?string
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getName(): ?string
  37.     {
  38.         return $this->name;
  39.     }
  40.     public function setName(string $name): self
  41.     {
  42.         $this->name $name;
  43.         return $this;
  44.     }
  45.     public function getHealth(): ?string
  46.     {
  47.         return $this->health;
  48.     }
  49.     public function setHealth(string $health): self
  50.     {
  51.         $this->health $health;
  52.         return $this;
  53.     }
  54.     public function getMoney(): ?int
  55.     {
  56.         return $this->money;
  57.     }
  58.     public function setMoney(int $money): self
  59.     {
  60.         $this->money $money;
  61.         return $this;
  62.     }
  63.     public function getSpec(): ?string
  64.     {
  65.         return $this->spec;
  66.     }
  67.     public function setSpec(string $spec): self
  68.     {
  69.         $this->spec $spec;
  70.         return $this;
  71.     }
  72.     public function getWorld(): ?World
  73.     {
  74.         return $this->world;
  75.     }
  76.     public function setWorld(?World $world): self
  77.     {
  78.         $this->world $world;
  79.         return $this;
  80.     }
  81.     public function getDescription(): string
  82.     {
  83.         return $this->description;
  84.     }
  85.     public function setDescription(string $description): self
  86.     {
  87.         $this->description $description;
  88.         return $this;
  89.     }
  90. }