<?php

namespace App\Entity;

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

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

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

    #[ORM\ManyToOne(targetEntity: Client::class, inversedBy: 'hardwareProfile')]
    #[ORM\JoinColumn(nullable: false)]
    private ?Client $client = null;

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

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

        $this->hardwareCollection = 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 getClient(): ?Client
    {
        return $this->client;
    }

    public function setClient(?Client $client): static
    {
        $this->client = $client;

        return $this;
    }

    /**
     * @return Collection<int, Hardware>
     */
    public function getHardwareCollection(): Collection
    {
        return $this->hardwareCollection;
    }

    public function addHardwareCollection(Hardware $hardwareCollection): static
    {
        if (!$this->hardwareCollection->contains($hardwareCollection)) {
            $this->hardwareCollection->add($hardwareCollection);
        }

        return $this;
    }

    public function removeHardwareCollection(Hardware $hardwareCollection): static
    {
        $this->hardwareCollection->removeElement($hardwareCollection);

        return $this;
    }
}
