<?php
namespace App\Entity;
use App\Repository\SecurityRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=SecurityRepository::class)
*/
class Security
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $labels;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $slugSecurity;
/**
* @ORM\ManyToMany(targetEntity=Product::class, inversedBy="securities")
*/
private $product;
public function __construct()
{
$this->product = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLabels(): ?string
{
return $this->labels;
}
public function setLabels(?string $labels): self
{
$this->labels = $labels;
return $this;
}
public function getSlugSecurity(): ?string
{
return $this->slugSecurity;
}
public function setSlugSecurity(?string $slugSecurity): self
{
$this->slugSecurity = $slugSecurity;
return $this;
}
/**
* @return Collection|Product[]
*/
public function getProduct(): Collection
{
return $this->product;
}
public function addProduct(Product $product): self
{
if (!$this->product->contains($product)) {
$this->product[] = $product;
}
return $this;
}
public function removeProduct(Product $product): self
{
$this->product->removeElement($product);
return $this;
}
}