src/Entity/MarketBulletin.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\MarketInfoBulletin;
  4. use DateTime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Exception;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * MarketInfoBulletin
  11.  *
  12.  * @ORM\Table(name="malys_market_bulletin")
  13.  * @ORM\Entity(repositoryClass="App\Repository\MarketBulletinRepository")
  14.  * @ORM\HasLifecycleCallbacks()
  15.  */
  16. class MarketBulletin
  17. {
  18.     /**
  19.      * @var int
  20.      *
  21.      * @ORM\Column(name="id", type="integer")
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @var string
  28.      *
  29.      * @ORM\Column(name="name", type="string", length=255)
  30.      */
  31.     private $name;
  32.     /**
  33.      * @ORM\OneToMany(targetEntity="App\Entity\MarketInfo", mappedBy="buyBulletin", cascade={"all"}, orphanRemoval=true)
  34.      * @ORM\OrderBy({"priority" = "ASC"})
  35.      * @Assert\Valid
  36.      */
  37.     protected $buyMarketInfos;
  38.     /**
  39.      * @var string
  40.      *
  41.      * @ORM\Column(name="buyTextDetails", type="text", nullable=true)
  42.      */
  43.     protected $buyTextDetails;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity="App\Entity\MarketInfo", mappedBy="dontBuyBulletin", cascade={"all"}, orphanRemoval=true)
  46.      * @ORM\OrderBy({"priority" = "ASC"})
  47.      * @Assert\Valid
  48.      */
  49.     protected $dontBuyMarketInfos;
  50.     /**
  51.      * @var string
  52.      *
  53.      * @ORM\Column(name="dontBuyTextDetails", type="text", nullable=true)
  54.      */
  55.     protected $dontBuyTextDetails;
  56.     public function __construct()
  57.     {
  58.         $this->buyMarketInfos    = new ArrayCollection();
  59.         $this->dontBuyMarketInfo = new ArrayCollection();
  60.     }
  61.     /**
  62.      * @var DateTime
  63.      *
  64.      * @ORM\Column(name="createdAt", type="datetime", nullable=false)
  65.      */
  66.     protected $createdAt;
  67.     /**
  68.      * @var DateTime
  69.      *
  70.      * @ORM\Column(name="updatedAt", type="datetime", nullable=true)
  71.      */
  72.     protected $updatedAt;
  73.     /**
  74.      * Get id
  75.      *
  76.      * @return int
  77.      */
  78.     public function getId()
  79.     {
  80.         return $this->id;
  81.     }
  82.     /**
  83.      * Set id
  84.      *
  85.      * @param integer $id
  86.      *
  87.      * @return MarketInfoBulletin
  88.      */
  89.     public function setId($id)
  90.     {
  91.         $this->id $id;
  92.         return $this;
  93.     }
  94.     /**
  95.      * Set name
  96.      *
  97.      * @param string $name
  98.      *
  99.      * @return MarketInfoBulletin
  100.      */
  101.     public function setName($name)
  102.     {
  103.         $this->name $name;
  104.         return $this;
  105.     }
  106.     /**
  107.      * Get name
  108.      *
  109.      * @return string
  110.      */
  111.     public function getName()
  112.     {
  113.         return $this->name;
  114.     }
  115.     /**
  116.      * @return mixed
  117.      */
  118.     public function getBuyMarketInfos()
  119.     {
  120.         return $this->buyMarketInfos;
  121.     }
  122.     /**
  123.      * @param mixed $marketInfos
  124.      */
  125.     public function setBuyMarketInfos($marketInfos)
  126.     {
  127.         $this->buyMarketInfos $marketInfos;
  128.     }
  129.     public function addBuyMarketInfo($marketInfo)
  130.     {
  131.         $this->buyMarketInfos->add($marketInfo);
  132.         $marketInfo->setBuyBulletin($this);
  133.         return $this;
  134.     }
  135.     public function removeBuyMarketInfo($marketInfo)
  136.     {
  137.         if ($this->buyMarketInfos->contains($marketInfo)) {
  138.             $this->buyMarketInfos->removeElement($marketInfo);
  139.         }
  140.         return $this;
  141.     }
  142.     /**
  143.      * @return mixed
  144.      */
  145.     public function getDontBuyMarketInfos()
  146.     {
  147.         return $this->dontBuyMarketInfos;
  148.     }
  149.     /**
  150.      * @param mixed $dontBuyMarketInfo
  151.      */
  152.     public function setDontBuyMarketInfos($dontBuyMarketInfos)
  153.     {
  154.         $this->dontBuyMarketInfos $dontBuyMarketInfos;
  155.     }
  156.     public function addDontBuyMarketInfo($marketInfo)
  157.     {
  158.         $this->dontBuyMarketInfos->add($marketInfo);
  159.         $marketInfo->setDontBuyBulletin($this);
  160.         return $this;
  161.     }
  162.     public function removeDontBuyMarketInfo($marketInfo)
  163.     {
  164.         if ($this->dontBuyMarketInfos->contains($marketInfo)) {
  165.             $this->dontBuyMarketInfos->removeElement($marketInfo);
  166.         }
  167.         return $this;
  168.     }
  169.     /**
  170.      * @return DateTime
  171.      */
  172.     public function getCreatedAt()
  173.     {
  174.         return $this->createdAt;
  175.     }
  176.     /**
  177.      * @return MarketBulletin
  178.      * @ORM\PrePersist()
  179.      * @throws Exception
  180.      */
  181.     public function setCreatedAt()
  182.     {
  183.         $this->createdAt = new DateTime();
  184.         $this->updatedAt = new DateTime();
  185.         return $this;
  186.     }
  187.     /**
  188.      * @return DateTime
  189.      */
  190.     public function getUpdatedAt()
  191.     {
  192.         return $this->updatedAt;
  193.     }
  194.     /**
  195.      * Set updatedAt
  196.      *
  197.      * @return MarketBulletin
  198.      * @ORM\PreUpdate
  199.      * @throws Exception
  200.      */
  201.     public function setUpdatedAt()
  202.     {
  203.         $this->updatedAt = new DateTime();
  204.         return $this;
  205.     }
  206.     /**
  207.      * @return string
  208.      */
  209.     public function getBuyTextDetails()
  210.     {
  211.         return $this->buyTextDetails;
  212.     }
  213.     /**
  214.      * @param string $buyTextDetails
  215.      */
  216.     public function setBuyTextDetails($buyTextDetails)
  217.     {
  218.         $this->buyTextDetails $buyTextDetails;
  219.     }
  220.     /**
  221.      * @return string
  222.      */
  223.     public function getDontBuyTextDetails()
  224.     {
  225.         return $this->dontBuyTextDetails;
  226.     }
  227.     /**
  228.      * @param string $dontBuyTextDetails
  229.      */
  230.     public function setDontBuyTextDetails($dontBuyTextDetails)
  231.     {
  232.         $this->dontBuyTextDetails $dontBuyTextDetails;
  233.     }
  234. }