src/Entity/Sample.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SampleRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. #[ORM\Entity(repositoryClassSampleRepository::class), ORM\Table(name'samples')]
  7. class Sample implements \Stringable
  8. {
  9.     #[ORM\IdORM\GeneratedValueORM\Column(type'integer')]
  10.     private $id;
  11.     #[ORM\ManyToOne(targetEntityCases::class), ORM\JoinColumn(name'case_id'nullablefalse)]
  12.     private $case;
  13.     #[ORM\Column(type'string'length255)]
  14.     private $type;
  15.     #[ORM\Column(type'string'length190uniquetrue)]
  16.     private $number;
  17.     #[Gedmo\Timestampable(on'create'), ORM\Column(type'datetime')]
  18.     private $createdAt;
  19.     #[Gedmo\Blameable(on'create'), ORM\ManyToOne(targetEntityUser::class), ORM\JoinColumn(name'created_by')]
  20.     private $createdBy;
  21.     public function getId(): ?int
  22.     {
  23.         return $this->id;
  24.     }
  25.     public function getCase(): ?Cases
  26.     {
  27.         return $this->case;
  28.     }
  29.     public function setCase(?Cases $case): self
  30.     {
  31.         $this->case $case;
  32.         return $this;
  33.     }
  34.     public function getType(): ?string
  35.     {
  36.         return $this->type;
  37.     }
  38.     public function setType(string $type): self
  39.     {
  40.         $this->type $type;
  41.         return $this;
  42.     }
  43.     public function getNumber(): ?string
  44.     {
  45.         return $this->number;
  46.     }
  47.     public function setNumber(string $number): self
  48.     {
  49.         $this->number $number;
  50.         return $this;
  51.     }
  52.     public function getCreatedAt(): ?\DateTimeInterface
  53.     {
  54.         return $this->createdAt;
  55.     }
  56.     public function getCreatedBy(): ?User
  57.     {
  58.         return $this->createdBy;
  59.     }
  60.     public function __toString(): string
  61.     {
  62.         return $this->getNumber();
  63.     }
  64. }