src/Entity/Traffic.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\TrafficRepository")
  6.  */
  7. class Traffic
  8. {
  9.     
  10.     const TYPE_VIEW 1;
  11.     const TYPE_IMPRESSION 2;
  12.     const TYPE_LINK_CLICK 3;
  13.     const TYPE_MEDIA_GROUP_ITEM_IMPRESSION 4;
  14.     const TYPE_MEDIA_GROUP_ITEM_CLICK 5;
  15.     const TYPE_LINK_CATCHALL 6;
  16.     /**
  17.      * @ORM\Id @ORM\Column(type="string", length=40)
  18.      */
  19.     private $hash;
  20.     /**
  21.      * @ORM\Id @ORM\Column(type="string", length=64)
  22.      */
  23.     private $user_token;
  24.     /**
  25.      * @ORM\Column(type="string", length=48)
  26.      */
  27.     private $user_ip;
  28.     /**
  29.      * @ORM\Column(type="string", length=255)
  30.      */
  31.     private $user_ua;
  32.     /**
  33.      * @ORM\Column(type="string", length=255)
  34.      */
  35.     private $user_refer;
  36.     /**
  37.      * @ORM\Column(type="string", length=255)
  38.      */
  39.     private $user_this_path;
  40.     /**
  41.      * @ORM\Column(type="string", length=64)
  42.      */
  43.     private $user_this_route;
  44.     /**
  45.      * @ORM\Column(type="string", length=255)
  46.      */
  47.     private $user_this_route_params;
  48.     /**
  49.      * @ORM\Column(type="string", length=255)
  50.      */
  51.     private $user_last_path;
  52.     /**
  53.      * @ORM\Column(type="string", length=64)
  54.      */
  55.     private $user_last_route;
  56.     /**
  57.      * @ORM\Column(type="string", length=255)
  58.      */
  59.     private $user_last_route_params;
  60.     /**
  61.      * @ORM\Column(type="text")
  62.      */
  63.     private $user_request_data;
  64.     
  65.     /**
  66.      * @ORM\Column(type="text")
  67.      */
  68.     private $link_catchall_href;
  69.     /**
  70.      * @ORM\Column(type="datetime")
  71.      */
  72.     private $requested_at;
  73.     /**
  74.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="traffic", cascade={"persist"})
  75.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
  76.      */
  77.     private $user;
  78.     
  79.     /**
  80.      * @ORM\ManyToOne(targetEntity="App\Entity\Content", inversedBy="traffic", cascade={"persist"})
  81.      * @ORM\JoinColumn(name="content_id", referencedColumnName="id", onDelete="CASCADE")
  82.      */
  83.     private $content;
  84.     
  85.     /**
  86.      * @ORM\ManyToOne(targetEntity="App\Entity\Link", inversedBy="traffic", cascade={"persist"})
  87.      * @ORM\JoinColumn(name="link_id", referencedColumnName="id", onDelete="CASCADE")
  88.      */
  89.     private $link;
  90.     
  91.     /**
  92.      * @ORM\ManyToOne(targetEntity="App\Entity\MediaGroupItem", inversedBy="traffic", cascade={"persist"})
  93.      * @ORM\JoinColumn(name="media_group_item_id", referencedColumnName="id", onDelete="CASCADE")
  94.      */
  95.     private $media_group_item;
  96.     
  97.     /**
  98.      * @ORM\Column(type="integer")
  99.      */
  100.     private $type;
  101.     
  102.     public function __construct()
  103.     {
  104.         $this->type 0;
  105.         $this->link_catchall_href "";
  106.     }
  107.     public function getId()
  108.     {
  109.         return $this->id;
  110.     }
  111.     public function getHash(): ?string
  112.     {
  113.         return $this->hash;
  114.     }
  115.     public function setHash(string $hash): self
  116.     {
  117.         $this->hash $hash;
  118.         return $this;
  119.     }
  120.     public function getUserToken(): ?string
  121.     {
  122.         return $this->user_token;
  123.     }
  124.     public function setUserToken(string $user_token): self
  125.     {
  126.         $this->user_token $user_token;
  127.         return $this;
  128.     }
  129.     public function getUserIp(): ?string
  130.     {
  131.         return $this->user_ip;
  132.     }
  133.     public function setUserIp(string $user_ip null): self
  134.     {
  135.         $this->user_ip $user_ip $user_ip "";
  136.         return $this;
  137.     }
  138.     public function getUserUa(): ?string
  139.     {
  140.         return $this->user_ua;
  141.     }
  142.     public function setUserUa(string $user_ua null): self
  143.     {
  144.         $this->user_ua $user_ua $user_ua "";
  145.         return $this;
  146.     }
  147.     public function getUserRefer(): ?string
  148.     {
  149.         return $this->user_refer;
  150.     }
  151.     public function setUserRefer(string $user_refer null): self
  152.     {
  153.         $this->user_refer $user_refer $user_refer "";
  154.         return $this;
  155.     }
  156.     public function getUserThisPath(): ?string
  157.     {
  158.         return $this->user_this_path;
  159.     }
  160.     public function setUserThisPath(string $user_this_path null): self
  161.     {
  162.         $this->user_this_path $user_this_path $user_this_path "";
  163.         //should we link this to content?
  164.         
  165.         return $this;
  166.     }
  167.     public function getUserThisRoute(): ?string
  168.     {
  169.         return $this->user_this_route;
  170.     }
  171.     public function setUserThisRoute(string $user_this_route null): self
  172.     {
  173.         $this->user_this_route $user_this_route $user_this_route "";
  174.         return $this;
  175.     }
  176.     public function getUserThisRouteParams(): ?string
  177.     {
  178.         return $this->user_this_route_params;
  179.     }
  180.     public function setUserThisRouteParams(string $user_this_route_params null): self
  181.     {
  182.         $this->user_this_route_params $user_this_route_params $user_this_route_params "";
  183.         return $this;
  184.     }
  185.     public function getUserLastPath(): ?string
  186.     {
  187.         return $this->user_last_path;
  188.     }
  189.     public function setUserLastPath(string $user_last_path null): self
  190.     {
  191.         $this->user_last_path $user_last_path $user_last_path "";
  192.         return $this;
  193.     }
  194.     public function getUserLastRoute(): ?string
  195.     {
  196.         return $this->user_last_route;
  197.     }
  198.     public function setUserLastRoute(string $user_last_route null): self
  199.     {
  200.         $this->user_last_route $user_last_route $user_last_route "";
  201.         return $this;
  202.     }
  203.     public function getUserLastRouteParams(): ?string
  204.     {
  205.         return $this->user_last_route_params;
  206.     }
  207.     public function setUserLastRouteParams(string $user_last_route_params null): self
  208.     {
  209.         $this->user_last_route_params $user_last_route_params $user_last_route_params "";
  210.         return $this;
  211.     }
  212.     public function getUserRequestData(): ?string
  213.     {
  214.         return $this->user_request_data;
  215.     }
  216.     public function setUserRequestData(string $user_request_data null): self
  217.     {
  218.         $this->user_request_data $user_request_data $user_request_data "";
  219.         return $this;
  220.     }
  221.     public function getLinkCatchallHref(): ?string
  222.     {
  223.         return $this->link_catchall_href;
  224.     }
  225.     public function setLinkCatchallHref(string $link_catchall_href null): self
  226.     {
  227.         $this->link_catchall_href $link_catchall_href $link_catchall_href "";
  228.         return $this;
  229.     }
  230.     public function getRequestedAt(): ?\DateTimeInterface
  231.     {
  232.         return $this->requested_at;
  233.     }
  234.     public function setRequestedAt(\DateTimeInterface $requested_at): self
  235.     {
  236.         $this->requested_at $requested_at;
  237.         return $this;
  238.     }
  239.     public function getUser(): ?User
  240.     {
  241.         return $this->user;
  242.     }
  243.     public function setUser(?User $user): self
  244.     {
  245.         $this->user $user;
  246.         return $this;
  247.     }
  248.     
  249.     public function getContent(): ?Content
  250.     {
  251.         return $this->content;
  252.     }
  253.     public function setContent(?Content $content): self
  254.     {
  255.         $this->content $content;
  256.         return $this;
  257.     }
  258.     
  259.     public function getLink(): ?Link
  260.     {
  261.         return $this->link;
  262.     }
  263.     public function setLink(?Link $link): self
  264.     {
  265.         $this->link $link;
  266.         return $this;
  267.     }
  268.     
  269.     public function getMediaGroupItem(): ?MediaGroupItem
  270.     {
  271.         return $this->media_group_item;
  272.     }
  273.     public function setMediaGroupItem(?MediaGroupItem $item): self
  274.     {
  275.         $this->media_group_item $item;
  276.         return $this;
  277.     }
  278.     
  279.     public function getType(): ?int
  280.     {
  281.         return $this->type;
  282.     }
  283.     
  284.     public function setType(int $type): self
  285.     {
  286.         $this->type $type;
  287.         return $this;
  288.     }
  289. }