<?php
namespace App\Entity;
use App\Entity\Traits\CommonTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity(repositoryClass="App\Repository\AdRepository")
* @ORM\Table(name="ad_ad")
* @UniqueEntity({"uuid"})
* @ORM\HasLifecycleCallbacks()
*/
class Ad
{
use CommonTrait;
/**
* @var string $title
* @ORM\Column(name="title", type="string", nullable=true)
*/
private $title;
/**
* @var string $link
* @ORM\Column(name="link", type="string", nullable=true)
*/
private $link;
/**
* @var boolean $newWindow
* @ORM\Column(name="new_window", type="boolean", nullable=true)
*/
private $newWindow = false;
/**
* @var \DateTime $createdAt
* @ORM\Column(name="created_at", type="datetime", nullable=true)
*/
private $createdAt;
/**
* @var \DateTime $updatedAt
* @ORM\Column(name="updated_at", type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @var integer $position
* @ORM\Column(name="position", type="integer", nullable=true)
*/
private $position = 0;
/**
* @ORM\ManyToOne(targetEntity=Campaign::class, inversedBy="ads")
*/
private $campaign;
/**
* To string
*
* @return string id
*/
public function __toString()
{
return $this->getTitle();
}
/**
* Set title
*
* @param string $title
* @return Ad
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set link
*
* @param string $link
* @return Ad
*/
public function setLink($link)
{
$this->link = $link;
return $this;
}
/**
* Get link
*
* @return string
*/
public function getLink()
{
return $this->link;
}
/**
* Set newWindow
*
* @param boolean $newWindow
* @return Ad
*/
public function setNewWindow($newWindow)
{
$this->newWindow = $newWindow;
return $this;
}
/**
* Get newWindow
*
* @return boolean
*/
public function getNewWindow()
{
return $this->newWindow;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
* @return Ad
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param \DateTime $updatedAt
* @return Ad
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set position
*
* @param integer $position
* @return Ad
*/
public function setPosition($position)
{
$this->position = $position;
return $this;
}
/**
* Get position
*
* @return integer
*/
public function getPosition()
{
return $this->position;
}
public function getCampaign(): ?Campaign
{
return $this->campaign;
}
public function setCampaign(?Campaign $campaign): self
{
$this->campaign = $campaign;
return $this;
}
}