src/Entity/PointPrefix.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use JsonSerializable;
  6. /**
  7. * @ORM\Entity
  8. * @ORM\Table(name="point_prefixes")
  9. * @package App\Entity
  10. */
  11. class PointPrefix implements JsonSerializable
  12. {
  13.     /**
  14.      * @ORM\Id()
  15.      * @ORM\GeneratedValue()
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255, nullable=true)
  21.      */
  22.     private $navFile;
  23.     /**
  24.      * @ORM\Column(type="string", length=255, nullable=true)
  25.      */
  26.     private $pointReplacement;
  27.     /**
  28.      * @ORM\Column(type="datetime", nullable=false)
  29.      */
  30.     private $dateAdded;
  31.     /**
  32.      * @ORM\Column(type="datetime", nullable=false)
  33.      */
  34.     private $dateModified;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity="App\Entity\Screen", inversedBy="pointPrefixes", fetch="EXTRA_LAZY", cascade={"persist"})
  37.      */
  38.     private $screen;
  39.     public function __construct()
  40.     {
  41.         $this->dateAdded = new \DateTime();
  42.         $this->setDateModified();
  43.     }
  44.     public function jsonSerialize()
  45.     {
  46.         return array(
  47.             'id'=> $this->id,
  48.             'navFile' => $this->navFile,
  49.             'pointReplacement' => $this->pointReplacement,
  50.             'dateAdded' => $this->dateAdded,
  51.             'dateModified' => $this->dateModified,
  52.         );
  53.     }
  54.     /**
  55.      * get id
  56.      *
  57.      * @return integer
  58.      */
  59.     public function getId()
  60.     {
  61.         return $this->id;
  62.     }
  63.     /**
  64.      * get date added
  65.      *
  66.      * @return DateTime
  67.      */
  68.     public function getDateAdded()
  69.     {
  70.         return $this->dateAdded;
  71.     }
  72.     /**
  73.      * get date modified
  74.      *
  75.      * @return DateTime
  76.      */
  77.     public function getDateModified()
  78.     {
  79.         return $this->dateModified;
  80.     }
  81.     /**
  82.      * set date modified
  83.      *
  84.      * @return DateTime
  85.      */
  86.     public function setDateModified()
  87.      {
  88.          $this->dateModified = new \DateTime("now");
  89.      }
  90.     /**
  91.      * get nav file
  92.      *
  93.      * @return String
  94.      */
  95.     public function getNavFile()
  96.     {
  97.         return $this->navFile;
  98.     }
  99.     /**
  100.      * set nav file
  101.      *
  102.      * @return String
  103.      */
  104.     public function setNavFile$navFile )
  105.      {
  106.          $this->navFile $navFile;
  107.      }
  108.     /**
  109.      * get pointReplacement
  110.      *
  111.      * @return String
  112.      */
  113.     public function getPointReplacement()
  114.     {
  115.         return $this->pointReplacement;
  116.     }
  117.     /**
  118.      * set pointReplacement
  119.      *
  120.      * @return String
  121.      */
  122.     public function setPointReplacement$pointReplacement )
  123.      {
  124.          $this->pointReplacement $pointReplacement;
  125.      }
  126.     /**
  127.      * set screen
  128.      *
  129.      * @param \App\Entity\Screen $screen
  130.      *
  131.      * @return ScreenPoint
  132.      */
  133.     public function setScreen(\App\Entity\Screen $screen)
  134.     {
  135.         $this->screen $screen;
  136.         $screen->addScreenPoint($this);
  137.         return $this;
  138.     }
  139.     /**
  140.      * unset screen
  141.      *
  142.      * @param \App\Entity\Screen $screen
  143.      *
  144.      * @return ScreenPoint
  145.      */
  146.     public function unsetScreen(\App\Entity\Screen $screen)
  147.     {
  148.         $screen->removeScreenPoint($this);
  149.         $this->screen null;
  150.         return $this;
  151.     }
  152.     public function getScreen()
  153.     {
  154.         return $this->screen;
  155.     }
  156. }