src/Entity/UserDevice.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserDeviceRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Entity(repositoryClass=UserDeviceRepository::class)
  9.  */
  10. class UserDevice
  11. {
  12.     const IOS "iOS";
  13.     const ANDROID "Android";
  14.     const AMAZON "Amazon";
  15.     const WINDOWSPHONE "WindowsPhone"// (MPNS)
  16.     const CHROME_APPS "Chrome Apps"// Extensions
  17.     const CHROME_WEB_PUSH "Chrome Web Push";
  18.     const WINDOWS "Windows"// (WNS)    
  19.     const SAFARI "Safari";
  20.     const FIREFOX "Firefox";
  21.     const MACOS "MacOS";
  22.     const ALEXA "Alexa";
  23.     const EMAIL "Email";
  24.     const HUAWEI "Huawei";
  25.     const SMS "SMS";
  26.     const OS = [
  27.         self::IOS,
  28.         self::ANDROID,
  29.         self::AMAZON,
  30.         self::WINDOWSPHONE,
  31.         self::CHROME_APPS,
  32.         self::CHROME_WEB_PUSH,
  33.         self::WINDOWS,
  34.         self::SAFARI,
  35.         self::FIREFOX,
  36.         self::MACOS,
  37.         self::ALEXA,
  38.         self::EMAIL,
  39.         self::HUAWEI,
  40.         self::SMS,
  41.     ];
  42.     /**
  43.      * @ORM\Id
  44.      * @ORM\GeneratedValue
  45.      * @ORM\Column(type="integer")
  46.      */
  47.     private $id;
  48.     /**
  49.      * @ORM\ManyToOne(targetEntity=TvUser::class, inversedBy="devices")
  50.      */
  51.     private $tvUser;
  52.     /**
  53.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="devices")
  54.      * @Assert\NotNull
  55.      */
  56.     private $user;
  57.     /**
  58.      * @ORM\Column(type="string", length=255, nullable=true)
  59.      */
  60.     private $os;
  61.     /**
  62.      * @ORM\Column(type="string", length=255, nullable=true)
  63.      */
  64.     private $token;
  65.     /**
  66.      * @ORM\Column(type="string", length=255, nullable=true)
  67.      */
  68.     private $model;
  69.     /**
  70.      * @ORM\Column(type="string", length=255, nullable=true)
  71.      */
  72.     private $osVersion;
  73.     /**
  74.      * @ORM\Column(type="string", length=255, nullable=true)
  75.      */
  76.     private $onesignalId;
  77.     /**
  78.      * @ORM\Column(type="boolean", options={"default": 1})
  79.      */
  80.     private $active true;
  81.     /**
  82.      * @ORM\Column(type="datetime", nullable=true)
  83.      */
  84.     private $lastActive;
  85.     /**
  86.      * @ORM\Column(type="datetime", nullable=true)
  87.      * @Gedmo\Timestampable(on="create")
  88.      */
  89.     private $createdAt;
  90.     /**
  91.      * @ORM\Column(type="datetime", nullable=true)
  92.      * @Gedmo\Timestampable(on="update")
  93.      */
  94.     private $updatedAt;
  95.     public function getId(): ?int
  96.     {
  97.         return $this->id;
  98.     }
  99.     public function getTvUser(): ?TvUser
  100.     {
  101.         return $this->tvUser;
  102.     }
  103.     public function setTvUser(?TvUser $tvUser): self
  104.     {
  105.         $this->tvUser $tvUser;
  106.         return $this;
  107.     }
  108.     public function getUser(): ?User
  109.     {
  110.         return $this->user;
  111.     }
  112.     public function setUser(?User $user): self
  113.     {
  114.         $this->user $user;
  115.         return $this;
  116.     }
  117.     public function getOs(): ?string
  118.     {
  119.         return $this->os;
  120.     }
  121.     public function setOs(string $os): self
  122.     {
  123.         $this->os $os;
  124.         return $this;
  125.     }
  126.     public function getToken(): ?string
  127.     {
  128.         return $this->token;
  129.     }
  130.     public function setToken(?string $token): self
  131.     {
  132.         $this->token $token;
  133.         return $this;
  134.     }
  135.     public function getModel(): ?string
  136.     {
  137.         return $this->model;
  138.     }
  139.     public function setModel(?string $model): self
  140.     {
  141.         $this->model $model;
  142.         return $this;
  143.     }
  144.     public function getOsVersion(): ?string
  145.     {
  146.         return $this->osVersion;
  147.     }
  148.     public function setOsVersion(?string $osVersion): self
  149.     {
  150.         $this->osVersion $osVersion;
  151.         return $this;
  152.     }
  153.     public function getLastActive(): ?\DateTimeInterface
  154.     {
  155.         return $this->lastActive;
  156.     }
  157.     public function setLastActive(?\DateTimeInterface $lastActive): self
  158.     {
  159.         $this->lastActive $lastActive;
  160.         return $this;
  161.     }
  162.     public function getCreatedAt(): ?\DateTimeInterface
  163.     {
  164.         return $this->createdAt;
  165.     }
  166.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  167.     {
  168.         $this->createdAt $createdAt;
  169.         return $this;
  170.     }
  171.     public function getUpdatedAt(): ?\DateTimeInterface
  172.     {
  173.         return $this->updatedAt;
  174.     }
  175.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  176.     {
  177.         $this->updatedAt $updatedAt;
  178.         return $this;
  179.     }
  180.     public function isActive(): ?bool
  181.     {
  182.         return $this->active;
  183.     }
  184.     public function setActive(bool $active): self
  185.     {
  186.         $this->active $active;
  187.         return $this;
  188.     }
  189.     public function getOnesignalId(): ?string
  190.     {
  191.         return $this->onesignalId;
  192.     }
  193.     public function setOnesignalId(?string $onesignalId): self
  194.     {
  195.         $this->onesignalId $onesignalId;
  196.         return $this;
  197.     }
  198. }