<?php

namespace App\Entity;

use App\Repository\SoftwareProfileRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass: SoftwareProfileRepository::class)]
class SoftwareProfile extends AbstractEntity
{
    #[ORM\Column(length: 255, nullable: true)]
    private ?string $description = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $comments = null;

    #[ORM\ManyToOne(inversedBy: 'softwareProfiles')]
    #[ORM\JoinColumn(nullable: false)]
    private ?OrganizationalUnit $organizationalUnit = null;

    /**
     * @var Collection<int, Software>
     */
    #[ORM\ManyToMany(targetEntity: Software::class, inversedBy: 'softwareProfiles')]
    private Collection $softwareCollection;

    #[ORM\ManyToOne]
    #[ORM\JoinColumn(nullable: true)]
    private ?OperativeSystem $operativeSystem = null;

    public function __construct()
    {
        parent::__construct();

        $this->softwareCollection = new ArrayCollection();
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getDescription(): ?string
    {
        return $this->description;
    }

    public function setDescription(?string $description): static
    {
        $this->description = $description;

        return $this;
    }

    public function getComments(): ?string
    {
        return $this->comments;
    }

    public function setComments(?string $comments): static
    {
        $this->comments = $comments;

        return $this;
    }

    public function getOrganizationalUnit(): ?OrganizationalUnit
    {
        return $this->organizationalUnit;
    }

    public function setOrganizationalUnit(?OrganizationalUnit $organizationalUnit): static
    {
        $this->organizationalUnit = $organizationalUnit;

        return $this;
    }

    /**
     * @return Collection<int, Software>
     */
    public function getSoftwareCollection(): Collection
    {
        return $this->softwareCollection;
    }

    public function addSoftwareCollection(Software $softwareCollection): static
    {
        if (!$this->softwareCollection->contains($softwareCollection)) {
            $this->softwareCollection->add($softwareCollection);
        }

        return $this;
    }

    public function removeSoftwareCollection(Software $softwareCollection): static
    {
        $this->softwareCollection->removeElement($softwareCollection);

        return $this;
    }

    public function getOperativeSystem(): ?OperativeSystem
    {
        return $this->operativeSystem;
    }

    public function setOperativeSystem(?OperativeSystem $operativeSystem): static
    {
        $this->operativeSystem = $operativeSystem;

        return $this;
    }
}
