src/Entity/Service.php line 13
<?phpnamespace App\Entity;use App\Repository\ServiceRepository;use App\Traits\TimeStampTrait;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ServiceRepository::class)]#[ORM\HasLifecycleCallbacks]class Service{use TimeStampTrait;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 100)]private ?string $code = null;#[ORM\Column(length: 50)]private ?string $name = null;#[ORM\Column]private ?bool $status = null;#[ORM\OneToMany(mappedBy: 'service', targetEntity: Incident::class)]private Collection $incidents;#[ORM\OneToMany(mappedBy: 'service', targetEntity: Prestataire::class)]private Collection $prestataires;#[ORM\ManyToOne(inversedBy: 'services')]private ?Entreprise $marchand = null;#[ORM\ManyToOne(inversedBy: 'services')]private ?User $createdBy = null;public function __construct(){$this->incidents = new ArrayCollection();$this->prestataires = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getCode(): ?string{return $this->code;}public function setCode(string $code): static{$this->code = $code;return $this;}public function getName(): ?string{return $this->name;}public function setName(string $name): static{$this->name = $name;return $this;}public function isStatus(): ?bool{return $this->status;}public function setStatus(bool $status): static{$this->status = $status;return $this;}/*** @return Collection<int, Incident>*/public function getIncidents(): Collection{return $this->incidents;}public function addIncident(Incident $incident): static{if (!$this->incidents->contains($incident)) {$this->incidents->add($incident);$incident->setService($this);}return $this;}public function removeIncident(Incident $incident): static{if ($this->incidents->removeElement($incident)) {// set the owning side to null (unless already changed)if ($incident->getService() === $this) {$incident->setService(null);}}return $this;}/*** @return Collection<int, Prestataire>*/public function getPrestataires(): Collection{return $this->prestataires;}public function addPrestataire(Prestataire $prestataire): static{if (!$this->prestataires->contains($prestataire)) {$this->prestataires->add($prestataire);$prestataire->setService($this);}return $this;}public function removePrestataire(Prestataire $prestataire): static{if ($this->prestataires->removeElement($prestataire)) {// set the owning side to null (unless already changed)if ($prestataire->getService() === $this) {$prestataire->setService(null);}}return $this;}public function __toString(): string{return $this->name;}public function getMarchand(): ?Entreprise{return $this->marchand;}public function setMarchand(?Entreprise $marchand): static{$this->marchand = $marchand;return $this;}public function getCreatedBy(): ?User{return $this->createdBy;}public function setCreatedBy(?User $createdBy): static{$this->createdBy = $createdBy;return $this;}}