<?php
namespace App\Entity;
use App\Repository\UtilitiesTypeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: UtilitiesTypeRepository::class)]
#[ORM\Index(columns: ['siglas'], name: 'utilities_type_siglas')]
class UtilitiesType
{
#[ORM\Id]
#[ORM\GeneratedValue(strategy: "IDENTITY")]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 60)]
private ?string $nameType = null;
#[ORM\Column(length: 3)]
private ?string $siglas = null;
#[ORM\OneToMany(mappedBy: 'utilitiesType', targetEntity: UtilitiesProperty::class)]
private Collection $utilitiesProperties;
#[ORM\Column(length: 100, nullable: true)]
private ?string $carpeta = null;
public function __construct()
{
$this->utilitiesProperties = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNameType(): ?string
{
return $this->nameType;
}
public function setNameType(string $nameType): static
{
$this->nameType = $nameType;
return $this;
}
public function getSiglas(): ?string
{
return $this->siglas;
}
public function setSiglas(string $siglas): static
{
$this->siglas = $siglas;
return $this;
}
/**
* @return Collection<int, UtilitiesProperty>
*/
public function getUtilitiesProperties(): Collection
{
return $this->utilitiesProperties;
}
public function addUtilitiesProperty(UtilitiesProperty $utilitiesProperty): static
{
if (!$this->utilitiesProperties->contains($utilitiesProperty)) {
$this->utilitiesProperties->add($utilitiesProperty);
$utilitiesProperty->setUtilitiesType($this);
}
return $this;
}
public function removeUtilitiesProperty(UtilitiesProperty $utilitiesProperty): static
{
if ($this->utilitiesProperties->removeElement($utilitiesProperty)) {
// set the owning side to null (unless already changed)
if ($utilitiesProperty->getUtilitiesType() === $this) {
$utilitiesProperty->setUtilitiesType(null);
}
}
return $this;
}
public function getCarpeta(): ?string
{
return $this->carpeta;
}
public function setCarpeta(?string $carpeta): static
{
$this->carpeta = $carpeta;
return $this;
}
}