<?php
/*
* This file is part of the kProjet project.
*
* (c) Kodiom <info@kodiom.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Entity\User;
/**
* Push
*
* @ApiResource
* @ORM\Table()
* @ORM\Entity(repositoryClass="App\Repository\PushRepository")
*/
class Push
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=30)
*
* @Assert\NotBlank()
*/
private $type;
/**
* @var string
*
* @ORM\Column(type="string", length=30)
*
* @Assert\NotBlank()
*/
private $mode;
/**
* @var string
*
* @ORM\Column(name="token", type="string", length=255, nullable=true)
*
*/
private $token;
/**
* @var string
*
* @ORM\Column(type="string", length=100)
*
* @Assert\NotBlank()
*/
private $userId;
// /**
// * @ORM\ManyToOne(targetEntity="App\Entity\User")
// * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
// */
// private $user;
public function __toString()
{
return ($this->getType()) ? $this->getType() : '';
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Get type
*
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* Set type
*
* @param string $type
*
* @return Push
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* Get mode
*
* @return string
*/
public function getMode()
{
return $this->mode;
}
/**
* Set mode
*
* @param string $mode
*
* @return Push
*/
public function setMode($mode)
{
$this->mode = $mode;
return $this;
}
/**
* Get token
*
* @return string
*/
public function getToken()
{
return $this->token;
}
/**
* Set token
*
* @param string $token
*
* @return Push
*/
public function setToken($token)
{
$this->token = $token;
return $this;
}
/**
* Get userId
*
* @return string
*/
public function getUserId()
{
return $this->userId;
}
/**
* Set userId
*
* @param string $userId
*
* @return Push
*/
public function setUserId($userId)
{
$this->userId = $userId;
return $this;
}
// public function getUser(): ?User
// {
// return $this->user;
// }
//
// public function setUser(?User $user): self
// {
// $this->user = $user;
//
// return $this;
// }
}