src/ProfileBundle/Entity/UserDevice.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\ProfileBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Table(
  6.  *     name="user_device_id",
  7.  *     indexes={@ORM\Index(name="user_device_user_idx", columns={"user_id"})},
  8.  *     uniqueConstraints={@ORM\UniqueConstraint(name="user_device_am_device_id_unique", columns={"user_id", "am_device_id"})}
  9.  * )
  10.  *
  11.  * @ORM\Entity(repositoryClass="App\ProfileBundle\Repository\UserDeviceRepository")
  12.  */
  13. class UserDevice
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\ManyToOne(targetEntity="App\ProfileBundle\Entity\User")
  18.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id",nullable=false, onDelete="CASCADE")
  19.      */
  20.     private User $user;
  21.     /**
  22.      * @ORM\Id
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private string $am_device_id;
  26.     /**
  27.      * @param User $user
  28.      * @param string $am_device_id
  29.      */
  30.     public function __construct(
  31.         User $user,
  32.         string $am_device_id
  33.     )
  34.     {
  35.         $this->user $user;
  36.         $this->am_device_id $am_device_id;
  37.     }
  38.     /**
  39.      * @return User
  40.      */
  41.     public function getUser(): User
  42.     {
  43.         return $this->user;
  44.     }
  45.     /**
  46.      * @param User $user
  47.      * @return $this
  48.      */
  49.     public function setUser(User $user): self
  50.     {
  51.         $this->user $user;
  52.         return $this;
  53.     }
  54.     /**
  55.      * @return string
  56.      */
  57.     public function getAmDeviceId(): string
  58.     {
  59.         return $this->am_device_id;
  60.     }
  61.     /**
  62.      * @param string $am_device_id
  63.      * @return $this
  64.      */
  65.     public function setAmDeviceId(string $am_device_id): self
  66.     {
  67.         $this->am_device_id $am_device_id;
  68.         return $this;
  69.     }
  70. }