src/Entity/Push.php line 27

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the kProjet project.
  4.  *
  5.  * (c) Kodiom <info@kodiom.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace App\Entity;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Symfony\Component\Validator\Constraints as Assert;
  13. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  14. use ApiPlatform\Core\Annotation\ApiResource;
  15. use App\Entity\User;
  16. /**
  17.  * Push
  18.  *
  19.  * @ApiResource
  20.  * @ORM\Table()
  21.  * @ORM\Entity(repositoryClass="App\Repository\PushRepository")
  22.  */
  23. class Push
  24. {
  25.     /**
  26.      * @var int
  27.      *
  28.      * @ORM\Column(name="id", type="integer")
  29.      * @ORM\Id
  30.      * @ORM\GeneratedValue(strategy="AUTO")
  31.      */
  32.     private $id;
  33.     /**
  34.      * @var string
  35.      *
  36.      * @ORM\Column(name="type", type="string", length=30)
  37.      *
  38.      * @Assert\NotBlank()
  39.      */
  40.     private $type;
  41.     /**
  42.      * @var string
  43.      *
  44.      * @ORM\Column(type="string", length=30)
  45.      *
  46.      * @Assert\NotBlank()
  47.      */
  48.     private $mode;
  49.     /**
  50.      * @var string
  51.      *
  52.      * @ORM\Column(name="token", type="string", length=255, nullable=true)
  53.      *
  54.      */
  55.     private $token;
  56.     /**
  57.      * @var string
  58.      *
  59.      * @ORM\Column(type="string", length=100)
  60.      *
  61.      * @Assert\NotBlank()
  62.      */
  63.     private $userId;
  64. //    /**
  65. //     * @ORM\ManyToOne(targetEntity="App\Entity\User")
  66. //     * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  67. //     */
  68. //    private $user;
  69.     public function __toString()
  70.     {
  71.         return ($this->getType()) ? $this->getType() : '';
  72.     }
  73.     /**
  74.      * Get id
  75.      *
  76.      * @return integer
  77.      */
  78.     public function getId()
  79.     {
  80.         return $this->id;
  81.     }
  82.     /**
  83.      * Get type
  84.      *
  85.      * @return string
  86.      */
  87.     public function getType()
  88.     {
  89.         return $this->type;
  90.     }
  91.     /**
  92.      * Set type
  93.      *
  94.      * @param string $type
  95.      *
  96.      * @return Push
  97.      */
  98.     public function setType($type)
  99.     {
  100.         $this->type $type;
  101.         return $this;
  102.     }
  103.     /**
  104.      * Get mode
  105.      *
  106.      * @return string
  107.      */
  108.     public function getMode()
  109.     {
  110.         return $this->mode;
  111.     }
  112.     /**
  113.      * Set mode
  114.      *
  115.      * @param string $mode
  116.      *
  117.      * @return Push
  118.      */
  119.     public function setMode($mode)
  120.     {
  121.         $this->mode $mode;
  122.         return $this;
  123.     }
  124.     /**
  125.      * Get token
  126.      *
  127.      * @return string
  128.      */
  129.     public function getToken()
  130.     {
  131.         return $this->token;
  132.     }
  133.     /**
  134.      * Set token
  135.      *
  136.      * @param string $token
  137.      *
  138.      * @return Push
  139.      */
  140.     public function setToken($token)
  141.     {
  142.         $this->token $token;
  143.         return $this;
  144.     }
  145.     /**
  146.      * Get userId
  147.      *
  148.      * @return string
  149.      */
  150.     public function getUserId()
  151.     {
  152.         return $this->userId;
  153.     }
  154.     /**
  155.      * Set userId
  156.      *
  157.      * @param string $userId
  158.      *
  159.      * @return Push
  160.      */
  161.     public function setUserId($userId)
  162.     {
  163.         $this->userId $userId;
  164.         return $this;
  165.     }
  166. //    public function getUser(): ?User
  167. //    {
  168. //        return $this->user;
  169. //    }
  170. //
  171. //    public function setUser(?User $user): self
  172. //    {
  173. //        $this->user = $user;
  174. //
  175. //        return $this;
  176. //    }
  177. }