src/Entity/PositionGps.php line 21

Open in your IDE?
  1. <?php
  2. /**
  3.  * @Author: tristan
  4.  * @Date:   2017-04-04 12:33:00
  5.  * @Last Modified by:   tristan
  6.  * @Last Modified time: 2017-04-07 17:40:31
  7.  */
  8. namespace App\Entity;
  9. use Cake\Chronos\Chronos;
  10. use Doctrine\DBAL\Types\Types;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Symfony\Component\Validator\Constraints as Assert;
  13. /**
  14.  * @ORM\Entity(repositoryClass="App\Repository\PositionGpsRepository")
  15.  * @ORM\Table(name="lf_posiiton_gps")
  16.  * @ORM\HasLifecycleCallbacks()
  17.  */
  18. class PositionGps
  19. {
  20.     /**
  21.      * @ORM\Id
  22.      * @ORM\Column(type="integer")
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.     protected $id;
  26.     /**
  27.      * @var string
  28.      * @ORM\Column(name="latitude", type="string", length=255, nullable=false)
  29.      * @Assert\NotBlank(
  30.      *      message="positonGps.latitude_required",
  31.      *      payload={"code" = "latitude_required"},
  32.      *      groups={"new"}
  33.      * )
  34.      */
  35.     protected $latitude;
  36.     /**
  37.      * @var string
  38.      * @ORM\Column(name="longitude", type="string", length=255, nullable=false)
  39.      * @Assert\NotBlank(
  40.      *      message="positionGps.longitude_required",
  41.      *      payload={"code" = "longitude_required"},
  42.      *      groups={"new"}
  43.      * )
  44.      */
  45.     protected $longitude;
  46.     /**
  47.      * @var integer
  48.      * @ORM\Column(name="speed", type="float", nullable=true)
  49.      */
  50.     protected $speed;
  51.     /**
  52.      * @var integer
  53.      * @ORM\Column(name="speed_accuracy", type="float", nullable=true)
  54.      */
  55.     protected $speedAccuracy;
  56.     /**
  57.      * @var integer
  58.      * @ORM\Column(name="altitude_ellipsoidal", type="float", nullable=true)
  59.      */
  60.     protected $altitudeEllipsoidal;
  61.     /**
  62.      * @var integer
  63.      * @ORM\Column(name="floor", type="float", nullable=true)
  64.      */
  65.     protected $floor;
  66.     /**
  67.      * @var integer
  68.      * @ORM\Column(name="heading_accuracy", type="float", nullable=true)
  69.      */
  70.     protected $heading;
  71.     /**
  72.      * @var integer
  73.      * @ORM\Column(name="heading", type="float", nullable=true)
  74.      */
  75.     protected $headingAccuracy;
  76.     /**
  77.      * @var integer
  78.      * @ORM\Column(name="altitude_accuracy", type="float", nullable=true)
  79.      */
  80.     protected $altitudeAccuracy;
  81.     /**
  82.      * @var integer
  83.      * @ORM\Column(name="altitude", type="decimal", nullable=true)
  84.      */
  85.     protected $altitude;
  86.     /**
  87.      * @var integer
  88.      * @ORM\Column(name="accuracy", type="float", nullable=true)
  89.      */
  90.     protected $accuracy;
  91.     /**
  92.      * @var integer
  93.      * @ORM\Column(name="bearing", type="float", nullable=true)
  94.      */
  95.     protected $bearing;
  96.     /**
  97.      * @var integer
  98.      * @ORM\Column(name="location_provider", type="string", length=255, nullable=true)
  99.      */
  100.     protected $locationProvider;
  101.     /**
  102.      * @var string
  103.      * @ORM\Column(name="provider", type="string", length=255, nullable=true)
  104.      */
  105.     protected $provider;
  106.     /**
  107.      * @var datetime
  108.      * @ORM\Column(name="datePrinted", type="datetime", nullable=true)
  109.      * @Assert\NotBlank(
  110.      *      message="positionGps.datePrinted_required",
  111.      *      payload={"code" = "datePrinted_required"},
  112.      *      groups={"new"}
  113.      * )
  114.      */
  115.     protected $datePrinted;
  116.     /**
  117.      * @var datetime
  118.      * @ORM\Column(name="dateCreatedByServer", type="datetime", nullable=true)
  119.      * @Assert\NotBlank(
  120.      *      message="positionGps.dateCreatedByServer_required",
  121.      *      payload={"code" = "dateCreatedByServer_required"},
  122.      *      groups={"new"}
  123.      * )
  124.      */
  125.     protected $dateCreatedByServer;
  126.     /**
  127.      * @var string
  128.      */
  129.     protected $datePrintedFormat;
  130.     /**
  131.      * @var string
  132.      */
  133.     protected $dateCreatedByServerFormat;
  134.     /**
  135.      * @var boolean
  136.      * @ORM\Column(name="mock", type="boolean", nullable=true)
  137.      */
  138.     protected $mock;
  139.     /**
  140.      * @var boolean
  141.      * @ORM\Column(name="is_moving", type="boolean", nullable=true)
  142.      */
  143.     protected $isMoving;
  144.     /**
  145.      * @var string
  146.      * @ORM\Column(name="event", type="string", nullable=true)
  147.      */
  148.     protected $event;
  149.     /**
  150.      * @var integer
  151.      * @ORM\Column(name="odometer", type="float", nullable=true)
  152.      */
  153.     protected $odometer;
  154.     /**
  155.      * @var string
  156.      * @ORM\Column(name="uuid", type="string", nullable=true)
  157.      */
  158.     protected $uuid;
  159.     /**
  160.      * @var string
  161.      * @ORM\Column(name="activity_type", type="string", nullable=true)
  162.      */
  163.     protected $activityType;
  164.     /**
  165.      * @var integer
  166.      * @ORM\Column(name="activity_confidence", type="float", nullable=true)
  167.      */
  168.     protected $activityConfidence;
  169.     /**
  170.      * @var integer
  171.      * @ORM\Column(name="battery_level", type="float", nullable=true)
  172.      */
  173.     protected $batteryLevel;
  174.     /**
  175.      * @var boolean
  176.      * @ORM\Column(name="battery_is_charging", type="boolean", nullable=true)
  177.      */
  178.     protected $batteryIsCharging;
  179.     /**
  180.      * @var boolean
  181.      * @ORM\Column(name="withFail", type="boolean", nullable=true)
  182.      */
  183.     protected $withFail;
  184.     /**
  185.      * @var boolean
  186.      * @ORM\Column(name="sync", type="boolean", nullable=true)
  187.      */
  188.     protected $sync;
  189.     /**
  190.      * @var integer
  191.      * @ORM\Column(name="groupe_id", type="string", length=255, nullable=true)
  192.      */
  193.     protected $groupeId;
  194.     /**
  195.      * @var user
  196.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="positionsGps")
  197.      */
  198.     protected $user;
  199.     public function __construct()
  200.     {
  201.         $this->dateCreatedByServer Chronos::now("UTC");
  202.     }
  203.     /**
  204.      * Get id
  205.      *
  206.      * @return integer
  207.      */
  208.     public function getId()
  209.     {
  210.         return $this->id;
  211.     }
  212.     /**
  213.      * Set latitude
  214.      *
  215.      * @param string $latitude
  216.      *
  217.      * @return PositionGps
  218.      */
  219.     public function setLatitude($latitude)
  220.     {
  221.         $this->latitude $latitude;
  222.         return $this;
  223.     }
  224.     /**
  225.      * Get latitude
  226.      *
  227.      * @return string
  228.      */
  229.     public function getLatitude()
  230.     {
  231.         return $this->latitude;
  232.     }
  233.     /**
  234.      * Set longitude
  235.      *
  236.      * @param string $longitude
  237.      *
  238.      * @return PositionGps
  239.      */
  240.     public function setLongitude($longitude)
  241.     {
  242.         $this->longitude $longitude;
  243.         return $this;
  244.     }
  245.     /**
  246.      * Get longitude
  247.      *
  248.      * @return string
  249.      */
  250.     public function getLongitude()
  251.     {
  252.         return $this->longitude;
  253.     }
  254.     /**
  255.      * Set datePrinted
  256.      *
  257.      * @param \DateTime $datePrinted
  258.      *
  259.      * @return PositionGps
  260.      */
  261.     public function setDatePrinted($datePrinted)
  262.     {
  263.         $this->datePrinted $datePrinted;
  264.         return $this;
  265.     }
  266.     /**
  267.      * Get datePrinted
  268.      *
  269.      * @return \DateTime
  270.      */
  271.     public function getDatePrinted()
  272.     {
  273.         return $this->datePrinted;
  274.     }
  275.     /**
  276.      * Get datePrintedFormat
  277.      *
  278.      * @return \String
  279.      */
  280.     public function getDatePrintedFormat()
  281.     {
  282.         $date $this->datePrinted->format("d-m-Y H:i:s");
  283.         return $date;
  284.     }
  285.     /**
  286.      * Set speed
  287.      *
  288.      * @param integer $speed
  289.      *
  290.      * @return PositionGps
  291.      */
  292.     public function setSpeed($speed)
  293.     {
  294.         $this->speed $speed;
  295.         return $this;
  296.     }
  297.     /**
  298.      * Get speed
  299.      *
  300.      * @return integer
  301.      */
  302.     public function getSpeed()
  303.     {
  304.         return $this->speed;
  305.     }
  306.     public function getDateCreatedByServer(): \DateTimeInterface
  307.     {
  308.         return $this->dateCreatedByServer;
  309.     }
  310.     public function setDateCreatedByServer(\DateTimeInterface $dateCreatedByServer): self
  311.     {
  312.         $this->dateCreatedByServer $dateCreatedByServer;
  313.         return $this;
  314.     }
  315.     /**
  316.      * Get dateCreatedByServerFormat
  317.      *
  318.      * @return \String
  319.      */
  320.     public function getDateCreatedByServerFormat()
  321.     {
  322.         if($this->dateCreatedByServer != null){
  323.             $dateServer $this->dateCreatedByServer->format("d-m-Y H:i:s");
  324.         }
  325.         else{
  326.             $dateServer null;
  327.         }
  328.         
  329.         return $dateServer;
  330.     }
  331.     /**
  332.      * Set withFail
  333.      *
  334.      * @param boolean $withFail
  335.      *
  336.      * @return PositionGps
  337.      */
  338.     public function setWithFail($withFail)
  339.     {
  340.         $this->withFail $withFail;
  341.         return $this;
  342.     }
  343.     /**
  344.      * Get withFail
  345.      *
  346.      * @return boolean
  347.      */
  348.     public function getWithFail()
  349.     {
  350.         return $this->withFail;
  351.     }
  352.     /**
  353.      * Set sync
  354.      *
  355.      * @param boolean $sync
  356.      *
  357.      * @return PositionGps
  358.      */
  359.     public function setSync($sync)
  360.     {
  361.         $this->sync $sync;
  362.         return $this;
  363.     }
  364.     /**
  365.      * Get sync
  366.      *
  367.      * @return boolean
  368.      */
  369.     public function getSync()
  370.     {
  371.         return $this->sync;
  372.     }
  373.     /**
  374.      * Set altitude.
  375.      *
  376.      * @param int|null $altitude
  377.      *
  378.      * @return PositionGps
  379.      */
  380.     public function setAltitude($altitude null)
  381.     {
  382.         $this->altitude $altitude;
  383.         return $this;
  384.     }
  385.     /**
  386.      * Get altitude.
  387.      *
  388.      * @return int|null
  389.      */
  390.     public function getAltitude()
  391.     {
  392.         return $this->altitude;
  393.     }
  394.     /**
  395.      * Set accuracy.
  396.      *
  397.      * @param int|null $accuracy
  398.      *
  399.      * @return PositionGps
  400.      */
  401.     public function setAccuracy($accuracy null)
  402.     {
  403.         $this->accuracy $accuracy;
  404.         return $this;
  405.     }
  406.     /**
  407.      * Get accuracy.
  408.      *
  409.      * @return int|null
  410.      */
  411.     public function getAccuracy()
  412.     {
  413.         return $this->accuracy;
  414.     }
  415.     /**
  416.      * Set bearing.
  417.      *
  418.      * @param int|null $bearing
  419.      *
  420.      * @return PositionGps
  421.      */
  422.     public function setBearing($bearing null)
  423.     {
  424.         $this->bearing $bearing;
  425.         return $this;
  426.     }
  427.     /**
  428.      * Get bearing.
  429.      *
  430.      * @return int|null
  431.      */
  432.     public function getBearing()
  433.     {
  434.         return $this->bearing;
  435.     }
  436.     /**
  437.      * Set locationProvider.
  438.      *
  439.      * @param int|null $locationProvider
  440.      *
  441.      * @return PositionGps
  442.      */
  443.     public function setLocationProvider($locationProvider null)
  444.     {
  445.         $this->locationProvider $locationProvider;
  446.         return $this;
  447.     }
  448.     /**
  449.      * Get locationProvider.
  450.      *
  451.      * @return int|null
  452.      */
  453.     public function getLocationProvider()
  454.     {
  455.         return $this->locationProvider;
  456.     }
  457.     /**
  458.      * Set provider.
  459.      *
  460.      * @param int|null $provider
  461.      *
  462.      * @return PositionGps
  463.      */
  464.     public function setProvider($provider null)
  465.     {
  466.         $this->provider $provider;
  467.         return $this;
  468.     }
  469.     /**
  470.      * Get provider.
  471.      *
  472.      * @return int|null
  473.      */
  474.     public function getProvider()
  475.     {
  476.         return $this->provider;
  477.     }
  478.     /**
  479.      * Set groupeId.
  480.      *
  481.      * @param string|null $groupeId
  482.      *
  483.      * @return PositionGps
  484.      */
  485.     public function setGroupeId($groupeId null)
  486.     {
  487.         $this->groupeId $groupeId;
  488.         return $this;
  489.     }
  490.     /**
  491.      * Get groupeId.
  492.      *
  493.      * @return string|null
  494.      */
  495.     public function getGroupeId()
  496.     {
  497.         return $this->groupeId;
  498.     }
  499.     /**
  500.      * Set user.
  501.      *
  502.      * @param \App\Entity\User|null $user
  503.      *
  504.      * @return PositionGps
  505.      */
  506.     public function setUser(\App\Entity\User $user null)
  507.     {
  508.         $this->user $user;
  509.         return $this;
  510.     }
  511.     /**
  512.      * Get user.
  513.      *
  514.      * @return \App\Entity\User|null
  515.      */
  516.     public function getUser()
  517.     {
  518.         return $this->user;
  519.     }
  520.     public function getSpeedAccuracy(): ?float
  521.     {
  522.         return $this->speedAccuracy;
  523.     }
  524.     public function setSpeedAccuracy(?float $speedAccuracy): self
  525.     {
  526.         $this->speedAccuracy $speedAccuracy;
  527.         return $this;
  528.     }
  529.     public function getAltitudeEllipsoidal(): ?float
  530.     {
  531.         return $this->altitudeEllipsoidal;
  532.     }
  533.     public function setAltitudeEllipsoidal(?float $altitudeEllipsoidal): self
  534.     {
  535.         $this->altitudeEllipsoidal $altitudeEllipsoidal;
  536.         return $this;
  537.     }
  538.     public function getFloor(): ?float
  539.     {
  540.         return $this->floor;
  541.     }
  542.     public function setFloor(?float $floor): self
  543.     {
  544.         $this->floor $floor;
  545.         return $this;
  546.     }
  547.     public function getHeading(): ?float
  548.     {
  549.         return $this->heading;
  550.     }
  551.     public function setHeading(?float $heading): self
  552.     {
  553.         $this->heading $heading;
  554.         return $this;
  555.     }
  556.     public function getHeadingAccuracy(): ?float
  557.     {
  558.         return $this->headingAccuracy;
  559.     }
  560.     public function setHeadingAccuracy(?float $headingAccuracy): self
  561.     {
  562.         $this->headingAccuracy $headingAccuracy;
  563.         return $this;
  564.     }
  565.     public function getAltitudeAccuracy(): ?float
  566.     {
  567.         return $this->altitudeAccuracy;
  568.     }
  569.     public function setAltitudeAccuracy(?float $altitudeAccuracy): self
  570.     {
  571.         $this->altitudeAccuracy $altitudeAccuracy;
  572.         return $this;
  573.     }
  574.     public function isMock(): ?bool
  575.     {
  576.         return $this->mock;
  577.     }
  578.     public function setMock(?bool $mock): self
  579.     {
  580.         $this->mock $mock;
  581.         return $this;
  582.     }
  583.     public function isIsMoving(): ?bool
  584.     {
  585.         return $this->isMoving;
  586.     }
  587.     public function setIsMoving(?bool $isMoving): self
  588.     {
  589.         $this->isMoving $isMoving;
  590.         return $this;
  591.     }
  592.     public function getEvent(): ?string
  593.     {
  594.         return $this->event;
  595.     }
  596.     public function setEvent(?string $event): self
  597.     {
  598.         $this->event $event;
  599.         return $this;
  600.     }
  601.     public function getOdometer(): ?float
  602.     {
  603.         return $this->odometer;
  604.     }
  605.     public function setOdometer(?float $odometer): self
  606.     {
  607.         $this->odometer $odometer;
  608.         return $this;
  609.     }
  610.     public function getUuid(): ?string
  611.     {
  612.         return $this->uuid;
  613.     }
  614.     public function setUuid(?string $uuid): self
  615.     {
  616.         $this->uuid $uuid;
  617.         return $this;
  618.     }
  619.     public function getActivityType(): ?string
  620.     {
  621.         return $this->activityType;
  622.     }
  623.     public function setActivityType(?string $activityType): self
  624.     {
  625.         $this->activityType $activityType;
  626.         return $this;
  627.     }
  628.     public function getActivityConfidence(): ?float
  629.     {
  630.         return $this->activityConfidence;
  631.     }
  632.     public function setActivityConfidence(?float $activityConfidence): self
  633.     {
  634.         $this->activityConfidence $activityConfidence;
  635.         return $this;
  636.     }
  637.     public function getBatteryLevel(): ?float
  638.     {
  639.         return $this->batteryLevel;
  640.     }
  641.     public function setBatteryLevel(?float $batteryLevel): self
  642.     {
  643.         $this->batteryLevel $batteryLevel;
  644.         return $this;
  645.     }
  646.     public function isBatteryIsCharging(): ?bool
  647.     {
  648.         return $this->batteryIsCharging;
  649.     }
  650.     public function setBatteryIsCharging(?bool $batteryIsCharging): self
  651.     {
  652.         $this->batteryIsCharging $batteryIsCharging;
  653.         return $this;
  654.     }
  655.     public function isWithFail(): ?bool
  656.     {
  657.         return $this->withFail;
  658.     }
  659.     public function isSync(): ?bool
  660.     {
  661.         return $this->sync;
  662.     }
  663. }