src/MDS/AvexpressBundle/Entity/AveProduct.php line 17

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\MDS\AvexpressBundle\Entity;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * AveProduct
  9.  *
  10.  * @ORM\Table(name="ave_product")
  11.  * @ORM\Entity(repositoryClass="App\MDS\AvexpressBundle\Repository\AveProductRepository")
  12.  */
  13. class AveProduct
  14. {
  15.     /**
  16.      * @var int
  17.      *
  18.      * @ORM\Column(name="id", type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @var string
  25.      *
  26.      * @ORM\Column(name="name", type="string", length=550)
  27.      */
  28.     private $name;
  29.     /**
  30.      * @var string|null
  31.      *
  32.      * @ORM\Column(name="nameEn", type="string", length=550, nullable=true)
  33.      */
  34.     private $nameEn;
  35.     /**
  36.      * @var string
  37.      *
  38.      * @ORM\Column(name="price", type="string", length=255)
  39.      */
  40.     private $price;
  41.     /**
  42.      * @var string
  43.      *
  44.      * @ORM\Column(name="type", type="string", length=255)
  45.      */
  46.     private $type;
  47.     /**
  48.      * @var string|null
  49.      *
  50.      * @ORM\Column(name="description", type="text", nullable=true)
  51.      */
  52.     private $description;
  53.     /**
  54.      * @var string|null
  55.      *
  56.      * @ORM\Column(name="descriptionEn", type="text", nullable=true)
  57.      */
  58.     private $descriptionEn;
  59.     /**
  60.      * @var \DateTime
  61.      *
  62.      * @ORM\Column(name="createdAt", type="datetime")
  63.      */
  64.     private $createdAt;
  65.     /**
  66.      * @var string
  67.      *
  68.      * @ORM\Column(name="createdId", type="string", length=255)
  69.      */
  70.     private $createdId;
  71.     /**
  72.      * @var \DateTime
  73.      *
  74.      * @ORM\Column(name="updatedAt", type="datetime")
  75.      */
  76.     private $updatedAt;
  77.     /**
  78.      * @var string
  79.      *
  80.      * @ORM\Column(name="updatedId", type="string", length=255)
  81.      */
  82.     private $updatedId;
  83.     /**
  84.      * @var string|null
  85.      *
  86.      * @ORM\Column(name="supplierExt", type="string", nullable=true)
  87.      */
  88.     private $supplierExt;
  89.     /**
  90.      * @var int|null
  91.      *
  92.      * @ORM\Column(name="supplierExtId", type="integer", nullable=true)
  93.      */
  94.     private $supplierExtId;
  95.     /**
  96.      * @ORM\ManyToMany(targetEntity="App\MDS\AvexpressBundle\Entity\AvePackageTemplate", inversedBy="products")
  97.      * @ORM\JoinTable(name="ave_product_package")
  98.      */
  99.     private Collection $packages;
  100.     public function __construct()
  101.     {
  102.         $this->packages = new ArrayCollection();
  103.     }
  104.     /**
  105.      * Get id
  106.      *
  107.      * @return int
  108.      */
  109.     public function getId()
  110.     {
  111.         return $this->id;
  112.     }
  113.     /**
  114.      * Set name
  115.      *
  116.      * @param string $name
  117.      *
  118.      * @return AveProduct
  119.      */
  120.     public function setName($name)
  121.     {
  122.         $this->name = $name;
  123.         return $this;
  124.     }
  125.     /**
  126.      * Get name
  127.      *
  128.      * @return string
  129.      */
  130.     public function getName()
  131.     {
  132.         return $this->name;
  133.     }
  134.     /**
  135.      * Set nameEn
  136.      *
  137.      * @param string|null $nameEn
  138.      *
  139.      * @return AveProduct
  140.      */
  141.     public function setNameEn(?string $nameEn)
  142.     {
  143.         $this->nameEn = $nameEn;
  144.         return $this;
  145.     }
  146.     /**
  147.      * Get nameEn
  148.      *
  149.      * @return string|null
  150.      */
  151.     public function getNameEn()
  152.     {
  153.         return $this->nameEn;
  154.     }
  155.     /**
  156.      * Set price
  157.      *
  158.      * @param string $price
  159.      *
  160.      * @return AveProduct
  161.      */
  162.     public function setPrice($price)
  163.     {
  164.         $this->price = $price;
  165.         return $this;
  166.     }
  167.     /**
  168.      * Get price
  169.      *
  170.      * @return string
  171.      */
  172.     public function getPrice()
  173.     {
  174.         return $this->price;
  175.     }
  176.     /**
  177.      * Set type
  178.      *
  179.      * @param string $type
  180.      *
  181.      * @return AveProduct
  182.      */
  183.     public function setType($type)
  184.     {
  185.         $this->type = $type;
  186.         return $this;
  187.     }
  188.     /**
  189.      * Get type
  190.      *
  191.      * @return string
  192.      */
  193.     public function getType()
  194.     {
  195.         return $this->type;
  196.     }
  197.     /**
  198.      * Set description
  199.      *
  200.      * @param string|null $description
  201.      *
  202.      * @return AveProduct
  203.      */
  204.     public function setDescription($description)
  205.     {
  206.         $this->description = $description;
  207.         return $this;
  208.     }
  209.     /**
  210.      * Get description
  211.      *
  212.      * @return string|null
  213.      */
  214.     public function getDescription()
  215.     {
  216.         return $this->description;
  217.     }
  218.     /**
  219.      * Set descriptionEn
  220.      *
  221.      * @param string|null $descriptionEn
  222.      *
  223.      * @return AveProduct
  224.      */
  225.     public function setDescriptionEn(?string $descriptionEn)
  226.     {
  227.         $this->descriptionEn = $descriptionEn;
  228.         return $this;
  229.     }
  230.     /**
  231.      * Get descriptionEn
  232.      *
  233.      * @return string|null
  234.      */
  235.     public function getDescriptionEn()
  236.     {
  237.         return $this->descriptionEn;
  238.     }
  239.     /**
  240.      * Set createdAt
  241.      *
  242.      * @param \DateTime $createdAt
  243.      *
  244.      * @return AveProduct
  245.      */
  246.     public function setCreatedAt($createdAt)
  247.     {
  248.         $this->createdAt = $createdAt;
  249.         return $this;
  250.     }
  251.     /**
  252.      * Get createdAt
  253.      *
  254.      * @return \DateTime
  255.      */
  256.     public function getCreatedAt()
  257.     {
  258.         return $this->createdAt;
  259.     }
  260.     /**
  261.      * Set createdId
  262.      *
  263.      * @param string $createdId
  264.      *
  265.      * @return AveProduct
  266.      */
  267.     public function setCreatedId($createdId)
  268.     {
  269.         $this->createdId = $createdId;
  270.         return $this;
  271.     }
  272.     /**
  273.      * Get createdId
  274.      *
  275.      * @return string
  276.      */
  277.     public function getCreatedId()
  278.     {
  279.         return $this->createdId;
  280.     }
  281.     /**
  282.      * Set updatedAt
  283.      *
  284.      * @param \DateTime $updatedAt
  285.      *
  286.      * @return AveProduct
  287.      */
  288.     public function setUpdatedAt($updatedAt)
  289.     {
  290.         $this->updatedAt = $updatedAt;
  291.         return $this;
  292.     }
  293.     /**
  294.      * Get updatedAt
  295.      *
  296.      * @return \DateTime
  297.      */
  298.     public function getUpdatedAt()
  299.     {
  300.         return $this->updatedAt;
  301.     }
  302.     /**
  303.      * Set updatedId
  304.      *
  305.      * @param string $updatedId
  306.      *
  307.      * @return AveProduct
  308.      */
  309.     public function setUpdatedId($updatedId)
  310.     {
  311.         $this->updatedId = $updatedId;
  312.         return $this;
  313.     }
  314.     /**
  315.      * Get updatedId
  316.      *
  317.      * @return string
  318.      */
  319.     public function getUpdatedId()
  320.     {
  321.         return $this->updatedId;
  322.     }
  323.     /**
  324.      * Set supplierExt
  325.      *
  326.      * @param string|null $supplierExt
  327.      *
  328.      * @return AveProduct
  329.      */
  330.     public function setSupplierExt($supplierExt)
  331.     {
  332.         $this->supplierExt = $supplierExt;
  333.         return $this;
  334.     }
  335.     /**
  336.      * Get supplierExt
  337.      *
  338.      * @return string|null
  339.      */
  340.     public function getSupplierExt()
  341.     {
  342.         return $this->supplierExt;
  343.     }
  344.     /**
  345.      * Set supplierExtId
  346.      *
  347.      * @param int|null $supplierExtId
  348.      *
  349.      * @return AveProduct
  350.      */
  351.     public function setSupplierExtId($supplierExtId)
  352.     {
  353.         $this->supplierExtId = $supplierExtId;
  354.         return $this;
  355.     }
  356.     /**
  357.      * Get supplierExtId
  358.      *
  359.      * @return int|null
  360.      */
  361.     public function getSupplierExtId()
  362.     {
  363.         return $this->supplierExtId;
  364.     }
  365.     /**
  366.      * @return Collection<int, AvePackageTemplate>
  367.      */
  368.     public function getPackages(): Collection
  369.     {
  370.         return $this->packages;
  371.     }
  372.     public function addPackage(AvePackageTemplate $package): self
  373.     {
  374.         if (!$this->packages->contains($package)) {
  375.             $this->packages->add($package);
  376.             $package->addProduct($this);
  377.         }
  378.         return $this;
  379.     }
  380.     public function removePackage(AvePackageTemplate $package): self
  381.     {
  382.         if ($this->packages->removeElement($package)) {
  383.             $package->removeProduct($this);
  384.         }
  385.         return $this;
  386.     }
  387. }