<?php
namespace App\Entity;
use App\Repository\SampleRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity(repositoryClass: SampleRepository::class), ORM\Table(name: 'samples')]
class Sample implements \Stringable
{
#[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Cases::class), ORM\JoinColumn(name: 'case_id', nullable: false)]
private $case;
#[ORM\Column(type: 'string', length: 255)]
private $type;
#[ORM\Column(type: 'string', length: 190, unique: true)]
private $number;
#[Gedmo\Timestampable(on: 'create'), ORM\Column(type: 'datetime')]
private $createdAt;
#[Gedmo\Blameable(on: 'create'), ORM\ManyToOne(targetEntity: User::class), ORM\JoinColumn(name: 'created_by')]
private $createdBy;
public function getId(): ?int
{
return $this->id;
}
public function getCase(): ?Cases
{
return $this->case;
}
public function setCase(?Cases $case): self
{
$this->case = $case;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getNumber(): ?string
{
return $this->number;
}
public function setNumber(string $number): self
{
$this->number = $number;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function getCreatedBy(): ?User
{
return $this->createdBy;
}
public function __toString(): string
{
return $this->getNumber();
}
}