Location.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. namespace MapBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use DeviceBundle\Interfaces\DeviceInterface;
  5. use ExtraDataBundle\Entity\Traits\ExtraDataTrait;
  6. /**
  7. * @ORM\Table
  8. * @ORM\Entity
  9. */
  10. class Location
  11. {
  12. use ExtraDataTrait;
  13. /**
  14. * @var int
  15. *
  16. * @ORM\Column(name="id", type="integer")
  17. * @ORM\Id
  18. * @ORM\GeneratedValue(strategy="AUTO")
  19. */
  20. private $id;
  21. /**
  22. * @var int
  23. *
  24. * @ORM\Column(type="integer", nullable=true)
  25. */
  26. private $mapId;
  27. /**
  28. * @return string
  29. */
  30. public function getData()
  31. {
  32. return array(
  33. 'mapId' => $this->mapId,
  34. 'extraData' => json_decode($this->extraData),
  35. );
  36. }
  37. /**
  38. * Get id
  39. *
  40. * @return int
  41. */
  42. public function getId()
  43. {
  44. return $this->id;
  45. }
  46. /**
  47. * @return DeviceInterface
  48. */
  49. public function getDevice()
  50. {
  51. return $this->device;
  52. }
  53. /**
  54. * @param DeviceInterface $device
  55. */
  56. public function setDevice(DeviceInterface $device)
  57. {
  58. $this->device = $device;
  59. }
  60. /**
  61. * Set mapId
  62. *
  63. * @param integer $mapId
  64. *
  65. * @return Location
  66. */
  67. public function setMapId($mapId = null)
  68. {
  69. $this->mapId = $mapId;
  70. return $this;
  71. }
  72. /**
  73. * Get mapId
  74. *
  75. * @return int
  76. */
  77. public function getMapId()
  78. {
  79. return $this->mapId;
  80. }
  81. }