<?php
namespace MLDev\CatalogBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use MLDev\CatalogBundle\Repository\BrandRepository;
/**
* @ORM\Table(name="MLDev_Brand")
* @ORM\Entity(repositoryClass=BrandRepository::class)
*/
class Brand
{
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(name="name", type="string", nullable=false)
*/
private $name;
/**
* @Gedmo\Slug(fields={"name"}, updatable=false, unique=true, separator="-")
* @ORM\Column(name="alias", type="string", length=255, nullable=false)
*/
private $alias;
/**
* @ORM\OneToMany(targetEntity=Product::class, mappedBy="brand")
*/
private $products;
public function __construct()
{
$this->products = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name)
{
$this->name = $name;
}
public function getAlias(): ?string
{
return $this->alias;
}
public function setAlias(?string $alias)
{
$this->alias = $alias;
}
public function getProducts(): iterable
{
return $this->products;
}
public function setProducts(iterable $products)
{
$this->products = $products;
}
}