src/Entity/MarketInfo.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Exception;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * MarketInfo
  9.  *
  10.  * @ORM\Table(name="malys_market_info")
  11.  * @ORM\Entity(repositoryClass="App\Repository\MarketInfoRepository")
  12.  * @ORM\HasLifecycleCallbacks()
  13.  */
  14. class MarketInfo
  15. {
  16.     /**
  17.      * @var int
  18.      *
  19.      * @ORM\Column(name="id", type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @var string
  26.      *
  27.      * @ORM\Column(name="name", type="string", length=255)
  28.      */
  29.     private $name;
  30.     /**
  31.      * @var string
  32.      *
  33.      * @ORM\Column(name="reason", type="string", length=255, nullable=true)
  34.      */
  35.     private $reason;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="advice", type="string", length=255)
  40.      */
  41.     private $advice;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity="App\Entity\MarketBulletin", inversedBy="buyMarketInfos")
  44.      * @ORM\JoinColumn(name="buy_bulletin_id", referencedColumnName="id")
  45.      */
  46.     protected $buyBulletin;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity="App\Entity\MarketBulletin", inversedBy="dontBuyMarketInfo")
  49.      * @ORM\JoinColumn(name="dont_buy_bulletin_id", referencedColumnName="id")
  50.      */
  51.     protected $dontBuyBulletin;
  52.     /**
  53.      * @var int
  54.      *
  55.      * @ORM\Column(name="priority", type="integer")
  56.      * @Assert\NotBlank()
  57.      * @Assert\GreaterThan(0)
  58.      */
  59.     private $priority;
  60.     /**
  61.      * @var DateTime
  62.      *
  63.      * @ORM\Column(name="createdAt", type="datetime", nullable=false)
  64.      */
  65.     protected $createdAt;
  66.     /**
  67.      * @var DateTime
  68.      *
  69.      * @ORM\Column(name="updatedAt", type="datetime", nullable=true)
  70.      */
  71.     protected $updatedAt;
  72.     /**
  73.      * Get id
  74.      *
  75.      * @return int
  76.      */
  77.     public function getId()
  78.     {
  79.         return $this->id;
  80.     }
  81.     /**
  82.      * Set name
  83.      *
  84.      * @param string $name
  85.      *
  86.      * @return MarketInfo
  87.      */
  88.     public function setName($name)
  89.     {
  90.         $this->name $name;
  91.         return $this;
  92.     }
  93.     /**
  94.      * Get name
  95.      *
  96.      * @return string
  97.      */
  98.     public function getName()
  99.     {
  100.         return $this->name;
  101.     }
  102.     /**
  103.      * Set reason
  104.      *
  105.      * @param string $reason
  106.      *
  107.      * @return MarketInfo
  108.      */
  109.     public function setReason($reason)
  110.     {
  111.         $this->reason $reason;
  112.         return $this;
  113.     }
  114.     /**
  115.      * Get reason
  116.      *
  117.      * @return string
  118.      */
  119.     public function getReason()
  120.     {
  121.         return $this->reason;
  122.     }
  123.     /**
  124.      * @return mixed
  125.      */
  126.     public function getBuyBulletin()
  127.     {
  128.         return $this->buyBulletin;
  129.     }
  130.     /**
  131.      * @param mixed $buyBulletin
  132.      */
  133.     public function setBuyBulletin($buyBulletin)
  134.     {
  135.         $this->buyBulletin $buyBulletin;
  136.     }
  137.     /**
  138.      * @return int
  139.      */
  140.     public function getPriority()
  141.     {
  142.         return $this->priority;
  143.     }
  144.     /**
  145.      * @param int $priority
  146.      */
  147.     public function setPriority($priority)
  148.     {
  149.         $this->priority $priority;
  150.     }
  151.     /**
  152.      * @return DateTime
  153.      */
  154.     public function getCreatedAt()
  155.     {
  156.         return $this->createdAt;
  157.     }
  158.     /**
  159.      * @return MarketInfo
  160.      * @ORM\PrePersist()
  161.      * @throws Exception
  162.      */
  163.     public function setCreatedAt()
  164.     {
  165.         $this->createdAt = new DateTime();
  166.         $this->updatedAt = new DateTime();
  167.         return $this;
  168.     }
  169.     /**
  170.      * @return DateTime
  171.      */
  172.     public function getUpdatedAt()
  173.     {
  174.         return $this->updatedAt;
  175.     }
  176.     /**
  177.      * Set updatedAt
  178.      *
  179.      * @return MarketInfo
  180.      * @ORM\PreUpdate
  181.      * @throws Exception
  182.      */
  183.     public function setUpdatedAt()
  184.     {
  185.         $updated = new DateTime();
  186.         return $this;
  187.     }
  188.     /**
  189.      * @return string
  190.      */
  191.     public function getAdvice()
  192.     {
  193.         return $this->advice;
  194.     }
  195.     /**
  196.      * @param string $advice
  197.      */
  198.     public function setAdvice($advice)
  199.     {
  200.         $this->advice $advice;
  201.     }
  202.     /**
  203.      * @return mixed
  204.      */
  205.     public function getDontBuyBulletin()
  206.     {
  207.         return $this->dontBuyBulletin;
  208.     }
  209.     /**
  210.      * @param mixed $dontBuyBulletin
  211.      */
  212.     public function setDontBuyBulletin($dontBuyBulletin)
  213.     {
  214.         $this->dontBuyBulletin $dontBuyBulletin;
  215.     }
  216. }