src/Entity/Ad.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\CommonTrait;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\AdRepository")
  8.  * @ORM\Table(name="ad_ad")
  9.  * @UniqueEntity({"uuid"})
  10.  * @ORM\HasLifecycleCallbacks()
  11.  */
  12. class Ad
  13. {
  14.     use CommonTrait;
  15.     /**
  16.      * @var string $title
  17.      * @ORM\Column(name="title", type="string", nullable=true)
  18.      */
  19.     private $title;
  20.     /**
  21.      * @var string $link
  22.      * @ORM\Column(name="link", type="string", nullable=true)
  23.      */
  24.     private $link;
  25.     /**
  26.      * @var boolean $newWindow
  27.      * @ORM\Column(name="new_window", type="boolean", nullable=true)
  28.      */
  29.     private $newWindow false;
  30.     /**
  31.      * @var \DateTime $createdAt
  32.      * @ORM\Column(name="created_at", type="datetime", nullable=true)
  33.      */
  34.     private $createdAt;
  35.     /**
  36.      * @var \DateTime $updatedAt
  37.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  38.      */
  39.     private $updatedAt;
  40.     /**
  41.      * @var integer $position
  42.      * @ORM\Column(name="position", type="integer", nullable=true)
  43.      */
  44.     private $position 0;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity=Campaign::class, inversedBy="ads")
  47.      */
  48.     private $campaign;
  49.     /**
  50.     * To string
  51.     * 
  52.     * @return string id
  53.     */ 
  54.     public function __toString()
  55.     {
  56.         return $this->getTitle();
  57.     }
  58.     /**
  59.      * Set title
  60.      *
  61.      * @param string $title
  62.      * @return Ad
  63.      */
  64.     public function setTitle($title)
  65.     {
  66.         $this->title $title;
  67.         return $this;
  68.     }
  69.     /**
  70.      * Get title
  71.      *
  72.      * @return string 
  73.      */
  74.     public function getTitle()
  75.     {
  76.         return $this->title;
  77.     }
  78.     /**
  79.      * Set link
  80.      *
  81.      * @param string $link
  82.      * @return Ad
  83.      */
  84.     public function setLink($link)
  85.     {
  86.         $this->link $link;
  87.         return $this;
  88.     }
  89.     /**
  90.      * Get link
  91.      *
  92.      * @return string 
  93.      */
  94.     public function getLink()
  95.     {
  96.         return $this->link;
  97.     }
  98.     /**
  99.      * Set newWindow
  100.      *
  101.      * @param boolean $newWindow
  102.      * @return Ad
  103.      */
  104.     public function setNewWindow($newWindow)
  105.     {
  106.         $this->newWindow $newWindow;
  107.         return $this;
  108.     }
  109.     /**
  110.      * Get newWindow
  111.      *
  112.      * @return boolean 
  113.      */
  114.     public function getNewWindow()
  115.     {
  116.         return $this->newWindow;
  117.     }
  118.     /**
  119.      * Set createdAt
  120.      *
  121.      * @param \DateTime $createdAt
  122.      * @return Ad
  123.      */
  124.     public function setCreatedAt($createdAt)
  125.     {
  126.         $this->createdAt $createdAt;
  127.         return $this;
  128.     }
  129.     /**
  130.      * Get createdAt
  131.      *
  132.      * @return \DateTime
  133.      */
  134.     public function getCreatedAt()
  135.     {
  136.         return $this->createdAt;
  137.     }
  138.     /**
  139.      * Set updatedAt
  140.      *
  141.      * @param \DateTime $updatedAt
  142.      * @return Ad
  143.      */
  144.     public function setUpdatedAt($updatedAt)
  145.     {
  146.         $this->updatedAt $updatedAt;
  147.         return $this;
  148.     }
  149.     /**
  150.      * Get updatedAt
  151.      *
  152.      * @return \DateTime
  153.      */
  154.     public function getUpdatedAt()
  155.     {
  156.         return $this->updatedAt;
  157.     }
  158.     /**
  159.      * Set position
  160.      *
  161.      * @param integer $position
  162.      * @return Ad
  163.      */
  164.     public function setPosition($position)
  165.     {
  166.         $this->position $position;
  167.         return $this;
  168.     }
  169.     /**
  170.      * Get position
  171.      *
  172.      * @return integer 
  173.      */
  174.     public function getPosition()
  175.     {
  176.         return $this->position;
  177.     }
  178.     public function getCampaign(): ?Campaign
  179.     {
  180.         return $this->campaign;
  181.     }
  182.     public function setCampaign(?Campaign $campaign): self
  183.     {
  184.         $this->campaign $campaign;
  185.         return $this;
  186.     }
  187. }