<?php
namespace App\Entity;
use App\Entity\MarketInfoBulletin;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Exception;
use Symfony\Component\Validator\Constraints as Assert;
/**
* MarketInfoBulletin
*
* @ORM\Table(name="malys_market_bulletin")
* @ORM\Entity(repositoryClass="App\Repository\MarketBulletinRepository")
* @ORM\HasLifecycleCallbacks()
*/
class MarketBulletin
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255)
*/
private $name;
/**
* @ORM\OneToMany(targetEntity="App\Entity\MarketInfo", mappedBy="buyBulletin", cascade={"all"}, orphanRemoval=true)
* @ORM\OrderBy({"priority" = "ASC"})
* @Assert\Valid
*/
protected $buyMarketInfos;
/**
* @var string
*
* @ORM\Column(name="buyTextDetails", type="text", nullable=true)
*/
protected $buyTextDetails;
/**
* @ORM\OneToMany(targetEntity="App\Entity\MarketInfo", mappedBy="dontBuyBulletin", cascade={"all"}, orphanRemoval=true)
* @ORM\OrderBy({"priority" = "ASC"})
* @Assert\Valid
*/
protected $dontBuyMarketInfos;
/**
* @var string
*
* @ORM\Column(name="dontBuyTextDetails", type="text", nullable=true)
*/
protected $dontBuyTextDetails;
public function __construct()
{
$this->buyMarketInfos = new ArrayCollection();
$this->dontBuyMarketInfo = new ArrayCollection();
}
/**
* @var DateTime
*
* @ORM\Column(name="createdAt", type="datetime", nullable=false)
*/
protected $createdAt;
/**
* @var DateTime
*
* @ORM\Column(name="updatedAt", type="datetime", nullable=true)
*/
protected $updatedAt;
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set id
*
* @param integer $id
*
* @return MarketInfoBulletin
*/
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* Set name
*
* @param string $name
*
* @return MarketInfoBulletin
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @return mixed
*/
public function getBuyMarketInfos()
{
return $this->buyMarketInfos;
}
/**
* @param mixed $marketInfos
*/
public function setBuyMarketInfos($marketInfos)
{
$this->buyMarketInfos = $marketInfos;
}
public function addBuyMarketInfo($marketInfo)
{
$this->buyMarketInfos->add($marketInfo);
$marketInfo->setBuyBulletin($this);
return $this;
}
public function removeBuyMarketInfo($marketInfo)
{
if ($this->buyMarketInfos->contains($marketInfo)) {
$this->buyMarketInfos->removeElement($marketInfo);
}
return $this;
}
/**
* @return mixed
*/
public function getDontBuyMarketInfos()
{
return $this->dontBuyMarketInfos;
}
/**
* @param mixed $dontBuyMarketInfo
*/
public function setDontBuyMarketInfos($dontBuyMarketInfos)
{
$this->dontBuyMarketInfos = $dontBuyMarketInfos;
}
public function addDontBuyMarketInfo($marketInfo)
{
$this->dontBuyMarketInfos->add($marketInfo);
$marketInfo->setDontBuyBulletin($this);
return $this;
}
public function removeDontBuyMarketInfo($marketInfo)
{
if ($this->dontBuyMarketInfos->contains($marketInfo)) {
$this->dontBuyMarketInfos->removeElement($marketInfo);
}
return $this;
}
/**
* @return DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @return MarketBulletin
* @ORM\PrePersist()
* @throws Exception
*/
public function setCreatedAt()
{
$this->createdAt = new DateTime();
$this->updatedAt = new DateTime();
return $this;
}
/**
* @return DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set updatedAt
*
* @return MarketBulletin
* @ORM\PreUpdate
* @throws Exception
*/
public function setUpdatedAt()
{
$this->updatedAt = new DateTime();
return $this;
}
/**
* @return string
*/
public function getBuyTextDetails()
{
return $this->buyTextDetails;
}
/**
* @param string $buyTextDetails
*/
public function setBuyTextDetails($buyTextDetails)
{
$this->buyTextDetails = $buyTextDetails;
}
/**
* @return string
*/
public function getDontBuyTextDetails()
{
return $this->dontBuyTextDetails;
}
/**
* @param string $dontBuyTextDetails
*/
public function setDontBuyTextDetails($dontBuyTextDetails)
{
$this->dontBuyTextDetails = $dontBuyTextDetails;
}
}