<?php
namespace App\Entity;
use App\Repository\UsSousModuleRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: UsSousModuleRepository::class)]
class UsSousModule
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'sousModules')]
private ?UsModule $module = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $link = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $designation = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $prefix = null;
#[ORM\Column]
private ?int $ordre = null;
#[ORM\OneToMany(mappedBy: 'sousModule', targetEntity: UsOperation::class)]
private Collection $operations;
public function __construct()
{
$this->operations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getModule(): ?UsModule
{
return $this->module;
}
public function setModule(?UsModule $module): self
{
$this->module = $module;
return $this;
}
public function getLink(): ?string
{
return $this->link;
}
public function setLink(?string $link): self
{
$this->link = $link;
return $this;
}
public function getDesignation(): ?string
{
return $this->designation;
}
public function setDesignation(?string $designation): self
{
$this->designation = $designation;
return $this;
}
public function getPrefix(): ?string
{
return $this->prefix;
}
public function setPrefix(?string $prefix): self
{
$this->prefix = $prefix;
return $this;
}
public function getOrdre(): ?int
{
return $this->ordre;
}
public function setOrdre(int $ordre): self
{
$this->ordre = $ordre;
return $this;
}
/**
* @return Collection<int, UsOperation>
*/
public function getOperations(): Collection
{
return $this->operations;
}
public function addOperation(UsOperation $operation): self
{
if (!$this->operations->contains($operation)) {
$this->operations->add($operation);
$operation->setSousModule($this);
}
return $this;
}
public function removeOperation(UsOperation $operation): self
{
if ($this->operations->removeElement($operation)) {
// set the owning side to null (unless already changed)
if ($operation->getSousModule() === $this) {
$operation->setSousModule(null);
}
}
return $this;
}
}