vendor/fri0z/mldev-catalog-bundle/src/Entity/Brand.php line 15

Open in your IDE?
  1. <?php
  2. namespace MLDev\CatalogBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use MLDev\CatalogBundle\Repository\BrandRepository;
  8. /**
  9.  * @ORM\Table(name="MLDev_Brand")
  10.  * @ORM\Entity(repositoryClass=BrandRepository::class)
  11.  */
  12. class Brand
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\Column(name="id", type="integer")
  17.      * @ORM\GeneratedValue(strategy="AUTO")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(name="name", type="string", nullable=false)
  22.      */
  23.     private $name;
  24.     /**
  25.      * @Gedmo\Slug(fields={"name"}, updatable=false, unique=true, separator="-")
  26.      * @ORM\Column(name="alias", type="string", length=255, nullable=false)
  27.      */
  28.     private $alias;
  29.     /**
  30.      * @ORM\OneToMany(targetEntity=Product::class, mappedBy="brand")
  31.      */
  32.     private $products;
  33.     public function __construct()
  34.     {
  35.         $this->products = new ArrayCollection();
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getName(): ?string
  42.     {
  43.         return $this->name;
  44.     }
  45.     public function setName(?string $name)
  46.     {
  47.         $this->name $name;
  48.     }
  49.     public function getAlias(): ?string
  50.     {
  51.         return $this->alias;
  52.     }
  53.     public function setAlias(?string $alias)
  54.     {
  55.         $this->alias $alias;
  56.     }
  57.     public function getProducts(): iterable
  58.     {
  59.         return $this->products;
  60.     }
  61.     public function setProducts(iterable $products)
  62.     {
  63.         $this->products $products;
  64.     }
  65. }