<?php
namespace App\ProfileBundle\Entity;
use App\CmsBundle\Entity\ParametersTrait;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use App\CasinoBundle\Entity\NewBonus;
use App\CasinoBundle\Entity\Casino;
/**
* @ORM\Table(
* name="user_event",
* indexes={
* @ORM\Index(name="ue_event_index", columns={"event"}),
* @ORM\Index(name="ue_user_id_index", columns={"user_id"}),
* @ORM\Index(name="ue_hash_event_index", columns={"hash_event"}, options={"using"="HASH"})
* }
* )
*
* @ORM\Entity(repositoryClass="App\ProfileBundle\Repository\UserEventRepository")
*/
class UserEvent
{
use ParametersTrait;
/**
* @var int
*
* @ORM\Column(name="id", type="bigint", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private int $id;
/**
* @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\NewBonus", inversedBy="userEvents", cascade={"persist"})
* @ORM\JoinColumn(name="bonus_id", referencedColumnName="id")
*/
private ?NewBonus $bonus;
/**
* @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\Casino", inversedBy="userEvents", cascade={"persist"})
* @ORM\JoinColumn(name="casino_id", referencedColumnName="id")
*/
private ?Casino $casino;
/**
* @ORM\ManyToOne(targetEntity="App\ProfileBundle\Entity\User", inversedBy="userEvents", cascade={"persist"})
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
private ?User $user;
/**
* @ORM\Column(name="event", type="integer", nullable=false)
*/
private ?string $event;
/**
* @ORM\Column(name="amp_event_id", type="integer", nullable=true)
*/
private ?int $ampEventId;
/**
* @var DateTime
*
* @ORM\Column(name="created", type="datetime")
*/
private DateTime $created;
/**
* @ORM\Column(name="hash_event", type="string")
*/
private string $hashEvent;
/**
* @ORM\Column(name="utm_source", type="string", nullable=true)
*/
private ?string $utmSource;
/**
* @var DateTime|null
*
* @ORM\Column(name="last_event_update", type="datetime", nullable=true)
*/
private ?DateTime $lastEventUpdate;
/**
* @var bool
* @ORM\Column(name="is_recognized", type="boolean", nullable=false, options={"default" = false})
*/
private bool $isRecognized = false;
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @param int $id
* @return $this
*/
public function setId(int $id): self
{
$this->id = $id;
return $this;
}
/**
* @return int|null
*/
public function getAmpEventId(): ?int
{
return $this->ampEventId;
}
/**
* @param int $ampEventId
* @return $this
*/
public function setAmpEventId(int $ampEventId): self
{
$this->ampEventId = $ampEventId;
return $this;
}
/**
* @return User|null
*/
public function getUser(): ?User
{
return $this->user;
}
/**
* @param User|null $user
* @return $this
*/
public function setUser(?User $user): self
{
$this->user = $user;
if ($user) {
$user->addUserEvent($this);
}
return $this;
}
/**
* @return Casino|null
*/
public function getCasino(): ?Casino
{
return $this->casino;
}
/**
* @param Casino|null $casino
* @return $this
*/
public function setCasino(?Casino $casino): self
{
$this->casino = $casino;
return $this;
}
/**
* @return NewBonus|null
*/
public function getBonus(): ?NewBonus
{
return $this->bonus;
}
/**
* @param NewBonus|null $bonus
* @return $this
*/
public function setBonus(?NewBonus $bonus): self
{
$this->bonus = $bonus;
return $this;
}
/**
* @return string|null
*/
public function getEvent(): ?string
{
return $this->event;
}
/**
* @param string|null $event
* @return $this
*/
public function setEvent(?string $event): self
{
$this->event = $event;
return $this;
}
/**
* Set created
*
* @param DateTime $created
* @return self
*/
public function setCreated(DateTime $created):self
{
$this->created = $created;
return $this;
}
/**
* Get created
*
* @return DateTime
*/
public function getCreated():DateTime
{
return $this->created;
}
/**
* @param $hashEvent
* @return $this
*/
public function setHashEvent($hashEvent): self
{
$this->hashEvent = $hashEvent;
return $this;
}
/**
* @return string
*/
public function getHashEvent(): string
{
return $this->hashEvent;
}
/**
* @param $utmSource
* @return $this
*/
public function setUtmSource($utmSource):self
{
$this->utmSource = $utmSource;
return $this;
}
/**
* @return string|null
*/
public function getUtmSource(): ?string
{
return $this->utmSource;
}
/**
* @param DateTime|null $lastEventUpdate
* @return $this
*/
public function setLastEventUpdate(?DateTime $lastEventUpdate = null):self
{
$this->lastEventUpdate = $lastEventUpdate;
return $this;
}
/**
* @return DateTime|null
*/
public function getLastEventUpdate(): ?DateTime
{
return $this->lastEventUpdate;
}
/**
* @return bool
*/
public function getIsRecognized(): bool
{
return $this->isRecognized;
}
/**
* @param bool $isRecognized
* @return $this
*/
public function setIsRecognized(bool $isRecognized): self
{
$this->isRecognized = $isRecognized;
return $this;
}
}