70 lines
1.7 KiB
PHP
70 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\SoftwareRepository;
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\Common\Collections\Collection;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
#[ORM\Entity(repositoryClass: SoftwareRepository::class)]
|
|
class Software extends AbstractEntity
|
|
{
|
|
use NameableTrait;
|
|
|
|
#[ORM\Column(length: 255, nullable: true)]
|
|
private ?string $description = null;
|
|
|
|
/**
|
|
* @var Collection<int, SoftwareProfile>
|
|
*/
|
|
#[ORM\ManyToMany(targetEntity: SoftwareProfile::class, mappedBy: 'softwareCollection')]
|
|
private Collection $softwareProfiles;
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->softwareProfiles = new ArrayCollection();
|
|
}
|
|
|
|
|
|
public function getDescription(): ?string
|
|
{
|
|
return $this->description;
|
|
}
|
|
|
|
public function setDescription(?string $description): static
|
|
{
|
|
$this->description = $description;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection<int, SoftwareProfile>
|
|
*/
|
|
public function getSoftwareProfiles(): Collection
|
|
{
|
|
return $this->softwareProfiles;
|
|
}
|
|
|
|
public function addSoftwareProfile(SoftwareProfile $softwareProfile): static
|
|
{
|
|
if (!$this->softwareProfiles->contains($softwareProfile)) {
|
|
$this->softwareProfiles->add($softwareProfile);
|
|
$softwareProfile->addSoftwareCollection($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeSoftwareProfile(SoftwareProfile $softwareProfile): static
|
|
{
|
|
if ($this->softwareProfiles->removeElement($softwareProfile)) {
|
|
$softwareProfile->removeSoftwareCollection($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
}
|