src/ProfileBundle/Entity/UserEvent.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\ProfileBundle\Entity;
  3. use App\CmsBundle\Entity\ParametersTrait;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\CasinoBundle\Entity\NewBonus;
  7. use App\CasinoBundle\Entity\Casino;
  8. /**
  9.  * @ORM\Table(
  10.  *     name="user_event",
  11.  *     indexes={
  12.  *          @ORM\Index(name="ue_event_index", columns={"event"}),
  13.  *          @ORM\Index(name="ue_user_id_index", columns={"user_id"}),
  14.  *          @ORM\Index(name="ue_hash_event_index", columns={"hash_event"}, options={"using"="HASH"})
  15.  *     }
  16.  * )
  17.  *
  18.  * @ORM\Entity(repositoryClass="App\ProfileBundle\Repository\UserEventRepository")
  19.  */
  20. class UserEvent
  21. {
  22.     use ParametersTrait;
  23.     /**
  24.      * @var int
  25.      *
  26.      * @ORM\Column(name="id", type="bigint", nullable=false)
  27.      * @ORM\Id
  28.      * @ORM\GeneratedValue(strategy="IDENTITY")
  29.      */
  30.     private int $id;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\NewBonus", inversedBy="userEvents", cascade={"persist"})
  33.      * @ORM\JoinColumn(name="bonus_id", referencedColumnName="id")
  34.      */
  35.     private ?NewBonus $bonus;
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\Casino", inversedBy="userEvents", cascade={"persist"})
  38.      * @ORM\JoinColumn(name="casino_id", referencedColumnName="id")
  39.      */
  40.     private ?Casino $casino;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity="App\ProfileBundle\Entity\User", inversedBy="userEvents", cascade={"persist"})
  43.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  44.      */
  45.     private ?User $user;
  46.     /**
  47.      * @ORM\Column(name="event", type="integer", nullable=false)
  48.      */
  49.     private ?string $event;
  50.     /**
  51.      * @ORM\Column(name="amp_event_id", type="integer", nullable=true)
  52.      */
  53.     private ?int $ampEventId;
  54.     /**
  55.      * @var DateTime
  56.      *
  57.      * @ORM\Column(name="created", type="datetime")
  58.      */
  59.     private DateTime $created;
  60.     /**
  61.      * @ORM\Column(name="hash_event", type="string")
  62.      */
  63.     private string $hashEvent;
  64.     /**
  65.      * @ORM\Column(name="utm_source", type="string", nullable=true)
  66.      */
  67.     private ?string $utmSource;
  68.     /**
  69.      * @var DateTime|null
  70.      *
  71.      * @ORM\Column(name="last_event_update", type="datetime", nullable=true)
  72.      */
  73.     private ?DateTime $lastEventUpdate;
  74.     /**
  75.      * @var bool
  76.      * @ORM\Column(name="is_recognized", type="boolean", nullable=false, options={"default" = false})
  77.      */
  78.     private bool $isRecognized false;
  79.     /**
  80.      * @return int|null
  81.      */
  82.     public function getId(): ?int
  83.     {
  84.         return $this->id;
  85.     }
  86.     /**
  87.      * @param int $id
  88.      * @return $this
  89.      */
  90.     public function setId(int $id): self
  91.     {
  92.         $this->id $id;
  93.         return $this;
  94.     }
  95.     /**
  96.      * @return int|null
  97.      */
  98.     public function getAmpEventId(): ?int
  99.     {
  100.         return $this->ampEventId;
  101.     }
  102.     /**
  103.      * @param int $ampEventId
  104.      * @return $this
  105.      */
  106.     public function setAmpEventId(int $ampEventId): self
  107.     {
  108.         $this->ampEventId $ampEventId;
  109.         return $this;
  110.     }
  111.     /**
  112.      * @return User|null
  113.      */
  114.     public function getUser(): ?User
  115.     {
  116.         return $this->user;
  117.     }
  118.     /**
  119.      * @param User|null $user
  120.      * @return $this
  121.      */
  122.     public function setUser(?User $user): self
  123.     {
  124.         $this->user $user;
  125.         if ($user) {
  126.             $user->addUserEvent($this);
  127.         }
  128.         return $this;
  129.     }
  130.     /**
  131.      * @return Casino|null
  132.      */
  133.     public function getCasino(): ?Casino
  134.     {
  135.         return $this->casino;
  136.     }
  137.     /**
  138.      * @param Casino|null $casino
  139.      * @return $this
  140.      */
  141.     public function setCasino(?Casino $casino): self
  142.     {
  143.         $this->casino $casino;
  144.         return $this;
  145.     }
  146.     /**
  147.      * @return NewBonus|null
  148.      */
  149.     public function getBonus(): ?NewBonus
  150.     {
  151.         return $this->bonus;
  152.     }
  153.     /**
  154.      * @param NewBonus|null $bonus
  155.      * @return $this
  156.      */
  157.     public function setBonus(?NewBonus $bonus): self
  158.     {
  159.         $this->bonus $bonus;
  160.         return $this;
  161.     }
  162.     /**
  163.      * @return string|null
  164.      */
  165.     public function getEvent(): ?string
  166.     {
  167.         return $this->event;
  168.     }
  169.     /**
  170.      * @param string|null $event
  171.      * @return $this
  172.      */
  173.     public function setEvent(?string $event): self
  174.     {
  175.         $this->event $event;
  176.         return $this;
  177.     }
  178.     /**
  179.      * Set created
  180.      *
  181.      * @param DateTime $created
  182.      * @return self
  183.      */
  184.     public function setCreated(DateTime $created):self
  185.     {
  186.         $this->created $created;
  187.         return $this;
  188.     }
  189.     /**
  190.      * Get created
  191.      *
  192.      * @return DateTime
  193.      */
  194.     public function getCreated():DateTime
  195.     {
  196.         return $this->created;
  197.     }
  198.     /**
  199.      * @param $hashEvent
  200.      * @return $this
  201.      */
  202.     public function setHashEvent($hashEvent): self
  203.     {
  204.         $this->hashEvent $hashEvent;
  205.         return $this;
  206.     }
  207.     /**
  208.      * @return string
  209.      */
  210.     public function getHashEvent(): string
  211.     {
  212.         return $this->hashEvent;
  213.     }
  214.     /**
  215.      * @param $utmSource
  216.      * @return $this
  217.      */
  218.     public function setUtmSource($utmSource):self
  219.     {
  220.         $this->utmSource $utmSource;
  221.         return $this;
  222.     }
  223.     /**
  224.      * @return string|null
  225.      */
  226.     public function getUtmSource(): ?string
  227.     {
  228.         return $this->utmSource;
  229.     }
  230.     /**
  231.      * @param DateTime|null $lastEventUpdate
  232.      * @return $this
  233.      */
  234.     public function setLastEventUpdate(?DateTime $lastEventUpdate null):self
  235.     {
  236.         $this->lastEventUpdate $lastEventUpdate;
  237.         return $this;
  238.     }
  239.     /**
  240.      * @return DateTime|null
  241.      */
  242.     public function getLastEventUpdate(): ?DateTime
  243.     {
  244.         return $this->lastEventUpdate;
  245.     }
  246.     /**
  247.      * @return bool
  248.      */
  249.     public function getIsRecognized(): bool
  250.     {
  251.         return $this->isRecognized;
  252.     }
  253.     /**
  254.      * @param bool $isRecognized
  255.      * @return $this
  256.      */
  257.     public function setIsRecognized(bool $isRecognized): self
  258.     {
  259.         $this->isRecognized $isRecognized;
  260.         return $this;
  261.     }
  262. }