resq/src/Service/Prowar/Entity/Retailer.php

61 lines
1.1 KiB
PHP

<?php
namespace App\Service\Prowar\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="retailer")
*/
class Retailer
{
// unique id
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
// name
/**
* @ORM\Column(type="string", length=80)
* @Assert\NotBlank()
*/
protected $name;
// distributors
/**
* @ORM\ManyToMany(targetEntity="Distributor", mappedBy="retailers", indexBy="id", fetch="EXTRA_LAZY")
*/
protected $distributors;
public function __construct()
{
$this->distributors = new ArrayCollection();
}
public function getID()
{
return $this->id;
}
public function setName($name)
{
$this->name = $name;
return $this;
}
public function getName()
{
return $this->name;
}
public function getDistributors()
{
return $this->distributors;
}
}