src/Entity/Analytic.php line 25

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 ApiPlatform\Core\Annotation\ApiResource;
  14. /**
  15.  * Analytic
  16.  *
  17.  * @ApiResource
  18.  * @ORM\Table()
  19.  * @ORM\Entity(repositoryClass="App\Repository\AnalyticRepository")
  20.  */
  21. class Analytic
  22. {
  23.     /**
  24.      * @var int
  25.      *
  26.      * @ORM\Column(name="id", type="integer")
  27.      * @ORM\Id
  28.      * @ORM\GeneratedValue(strategy="AUTO")
  29.      */
  30.     private $id;
  31.     /**
  32.      * @var string
  33.      *
  34.      * @ORM\Column(name="type", type="string", length=30)
  35.      *
  36.      * @Assert\NotBlank()
  37.      */
  38.     private $type;
  39.     /**
  40.      * @var string
  41.      *
  42.      * @ORM\Column(type="string", length=30)
  43.      *
  44.      * @Assert\NotBlank()
  45.      */
  46.     private $mode;
  47.     /**
  48.      * @var string
  49.      *
  50.      * @ORM\Column(type="string", length=100)
  51.      *
  52.      * @Assert\NotBlank()
  53.      */
  54.     private $userId;
  55.     /**
  56.      * @var date
  57.      *
  58.      * @ORM\Column(name="dateInfo", type="datetime")
  59.      */
  60.     private $dateInfo;
  61.     /**
  62.      * Constructor of Analytic Entity
  63.      */
  64.     public function __construct()
  65.     {
  66.         $this->dateInfo = new \DateTime;
  67.     }
  68.     public function __toString()
  69.     {
  70.         return ($this->getType()) ? $this->getType() : '';
  71.     }
  72.     /**
  73.      * Get id
  74.      *
  75.      * @return integer
  76.      */
  77.     public function getId()
  78.     {
  79.         return $this->id;
  80.     }
  81.     /**
  82.      * Get type
  83.      *
  84.      * @return string
  85.      */
  86.     public function getType()
  87.     {
  88.         return $this->type;
  89.     }
  90.     /**
  91.      * Set type
  92.      *
  93.      * @param string $type
  94.      *
  95.      * @return Analytic
  96.      */
  97.     public function setType($type)
  98.     {
  99.         $this->type $type;
  100.         return $this;
  101.     }
  102.     /**
  103.      * Get mode
  104.      *
  105.      * @return string
  106.      */
  107.     public function getMode()
  108.     {
  109.         return $this->mode;
  110.     }
  111.     /**
  112.      * Set mode
  113.      *
  114.      * @param string $mode
  115.      *
  116.      * @return Push
  117.      */
  118.     public function setMode($mode)
  119.     {
  120.         $this->mode $mode;
  121.         return $this;
  122.     }
  123.     /**
  124.      * Get userId
  125.      *
  126.      * @return string
  127.      */
  128.     public function getUserId()
  129.     {
  130.         return $this->userId;
  131.     }
  132.     /**
  133.      * Set userId
  134.      *
  135.      * @param string $userId
  136.      *
  137.      * @return Push
  138.      */
  139.     public function setUserId($userId)
  140.     {
  141.         $this->userId $userId;
  142.         return $this;
  143.     }
  144.     /**
  145.      * Get dateInfo
  146.      *
  147.      * @return date
  148.      */
  149.     public function getDateInfo()
  150.     {
  151.         return $this->dateInfo;
  152.     }
  153.     /**
  154.      * Set dateInfo
  155.      *
  156.      * @param date $dateInfo
  157.      *
  158.      * @return Analytic
  159.      */
  160.     public function setDateInfo($dateInfo)
  161.     {
  162.         $this->dateInfo $dateInfo;
  163.         return $this;
  164.     }
  165. }