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. return $dateServer;
  329. }
  330. /**
  331. * Set withFail
  332. *
  333. * @param boolean $withFail
  334. *
  335. * @return PositionGps
  336. */
  337. public function setWithFail($withFail)
  338. {
  339. $this->withFail = $withFail;
  340. return $this;
  341. }
  342. /**
  343. * Get withFail
  344. *
  345. * @return boolean
  346. */
  347. public function getWithFail()
  348. {
  349. return $this->withFail;
  350. }
  351. /**
  352. * Set sync
  353. *
  354. * @param boolean $sync
  355. *
  356. * @return PositionGps
  357. */
  358. public function setSync($sync)
  359. {
  360. $this->sync = $sync;
  361. return $this;
  362. }
  363. /**
  364. * Get sync
  365. *
  366. * @return boolean
  367. */
  368. public function getSync()
  369. {
  370. return $this->sync;
  371. }
  372. /**
  373. * Set altitude.
  374. *
  375. * @param int|null $altitude
  376. *
  377. * @return PositionGps
  378. */
  379. public function setAltitude($altitude = null)
  380. {
  381. $this->altitude = $altitude;
  382. return $this;
  383. }
  384. /**
  385. * Get altitude.
  386. *
  387. * @return int|null
  388. */
  389. public function getAltitude()
  390. {
  391. return $this->altitude;
  392. }
  393. /**
  394. * Set accuracy.
  395. *
  396. * @param int|null $accuracy
  397. *
  398. * @return PositionGps
  399. */
  400. public function setAccuracy($accuracy = null)
  401. {
  402. $this->accuracy = $accuracy;
  403. return $this;
  404. }
  405. /**
  406. * Get accuracy.
  407. *
  408. * @return int|null
  409. */
  410. public function getAccuracy()
  411. {
  412. return $this->accuracy;
  413. }
  414. /**
  415. * Set bearing.
  416. *
  417. * @param int|null $bearing
  418. *
  419. * @return PositionGps
  420. */
  421. public function setBearing($bearing = null)
  422. {
  423. $this->bearing = $bearing;
  424. return $this;
  425. }
  426. /**
  427. * Get bearing.
  428. *
  429. * @return int|null
  430. */
  431. public function getBearing()
  432. {
  433. return $this->bearing;
  434. }
  435. /**
  436. * Set locationProvider.
  437. *
  438. * @param int|null $locationProvider
  439. *
  440. * @return PositionGps
  441. */
  442. public function setLocationProvider($locationProvider = null)
  443. {
  444. $this->locationProvider = $locationProvider;
  445. return $this;
  446. }
  447. /**
  448. * Get locationProvider.
  449. *
  450. * @return int|null
  451. */
  452. public function getLocationProvider()
  453. {
  454. return $this->locationProvider;
  455. }
  456. /**
  457. * Set provider.
  458. *
  459. * @param int|null $provider
  460. *
  461. * @return PositionGps
  462. */
  463. public function setProvider($provider = null)
  464. {
  465. $this->provider = $provider;
  466. return $this;
  467. }
  468. /**
  469. * Get provider.
  470. *
  471. * @return int|null
  472. */
  473. public function getProvider()
  474. {
  475. return $this->provider;
  476. }
  477. /**
  478. * Set groupeId.
  479. *
  480. * @param string|null $groupeId
  481. *
  482. * @return PositionGps
  483. */
  484. public function setGroupeId($groupeId = null)
  485. {
  486. $this->groupeId = $groupeId;
  487. return $this;
  488. }
  489. /**
  490. * Get groupeId.
  491. *
  492. * @return string|null
  493. */
  494. public function getGroupeId()
  495. {
  496. return $this->groupeId;
  497. }
  498. /**
  499. * Set user.
  500. *
  501. * @param \App\Entity\User|null $user
  502. *
  503. * @return PositionGps
  504. */
  505. public function setUser(\App\Entity\User $user = null)
  506. {
  507. $this->user = $user;
  508. return $this;
  509. }
  510. /**
  511. * Get user.
  512. *
  513. * @return \App\Entity\User|null
  514. */
  515. public function getUser()
  516. {
  517. return $this->user;
  518. }
  519. public function getSpeedAccuracy(): ?float
  520. {
  521. return $this->speedAccuracy;
  522. }
  523. public function setSpeedAccuracy(?float $speedAccuracy): self
  524. {
  525. $this->speedAccuracy = $speedAccuracy;
  526. return $this;
  527. }
  528. public function getAltitudeEllipsoidal(): ?float
  529. {
  530. return $this->altitudeEllipsoidal;
  531. }
  532. public function setAltitudeEllipsoidal(?float $altitudeEllipsoidal): self
  533. {
  534. $this->altitudeEllipsoidal = $altitudeEllipsoidal;
  535. return $this;
  536. }
  537. public function getFloor(): ?float
  538. {
  539. return $this->floor;
  540. }
  541. public function setFloor(?float $floor): self
  542. {
  543. $this->floor = $floor;
  544. return $this;
  545. }
  546. public function getHeading(): ?float
  547. {
  548. return $this->heading;
  549. }
  550. public function setHeading(?float $heading): self
  551. {
  552. $this->heading = $heading;
  553. return $this;
  554. }
  555. public function getHeadingAccuracy(): ?float
  556. {
  557. return $this->headingAccuracy;
  558. }
  559. public function setHeadingAccuracy(?float $headingAccuracy): self
  560. {
  561. $this->headingAccuracy = $headingAccuracy;
  562. return $this;
  563. }
  564. public function getAltitudeAccuracy(): ?float
  565. {
  566. return $this->altitudeAccuracy;
  567. }
  568. public function setAltitudeAccuracy(?float $altitudeAccuracy): self
  569. {
  570. $this->altitudeAccuracy = $altitudeAccuracy;
  571. return $this;
  572. }
  573. public function isMock(): ?bool
  574. {
  575. return $this->mock;
  576. }
  577. public function setMock(?bool $mock): self
  578. {
  579. $this->mock = $mock;
  580. return $this;
  581. }
  582. public function isIsMoving(): ?bool
  583. {
  584. return $this->isMoving;
  585. }
  586. public function setIsMoving(?bool $isMoving): self
  587. {
  588. $this->isMoving = $isMoving;
  589. return $this;
  590. }
  591. public function getEvent(): ?string
  592. {
  593. return $this->event;
  594. }
  595. public function setEvent(?string $event): self
  596. {
  597. $this->event = $event;
  598. return $this;
  599. }
  600. public function getOdometer(): ?float
  601. {
  602. return $this->odometer;
  603. }
  604. public function setOdometer(?float $odometer): self
  605. {
  606. $this->odometer = $odometer;
  607. return $this;
  608. }
  609. public function getUuid(): ?string
  610. {
  611. return $this->uuid;
  612. }
  613. public function setUuid(?string $uuid): self
  614. {
  615. $this->uuid = $uuid;
  616. return $this;
  617. }
  618. public function getActivityType(): ?string
  619. {
  620. return $this->activityType;
  621. }
  622. public function setActivityType(?string $activityType): self
  623. {
  624. $this->activityType = $activityType;
  625. return $this;
  626. }
  627. public function getActivityConfidence(): ?float
  628. {
  629. return $this->activityConfidence;
  630. }
  631. public function setActivityConfidence(?float $activityConfidence): self
  632. {
  633. $this->activityConfidence = $activityConfidence;
  634. return $this;
  635. }
  636. public function getBatteryLevel(): ?float
  637. {
  638. return $this->batteryLevel;
  639. }
  640. public function setBatteryLevel(?float $batteryLevel): self
  641. {
  642. $this->batteryLevel = $batteryLevel;
  643. return $this;
  644. }
  645. public function isBatteryIsCharging(): ?bool
  646. {
  647. return $this->batteryIsCharging;
  648. }
  649. public function setBatteryIsCharging(?bool $batteryIsCharging): self
  650. {
  651. $this->batteryIsCharging = $batteryIsCharging;
  652. return $this;
  653. }
  654. public function isWithFail(): ?bool
  655. {
  656. return $this->withFail;
  657. }
  658. public function isSync(): ?bool
  659. {
  660. return $this->sync;
  661. }
  662. }