Server.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace JMS\Serializer\Tests\Fixtures\Doctrine\IdentityFields;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use JMS\Serializer\Annotation as Serializer;
  5. /** @ORM\Entity */
  6. class Server
  7. {
  8. /**
  9. * @ORM\Id
  10. * @ORM\Column(type="string", name="ip_address")
  11. * @Serializer\Type("string")
  12. * @var string
  13. */
  14. protected $ipAddress;
  15. /**
  16. * @ORM\Id
  17. * @ORM\Column(type="string", name="server_id")
  18. * @Serializer\SerializedName("server_id_extracted")
  19. * @Serializer\Type("string")
  20. * @var string
  21. */
  22. protected $serverId;
  23. /**
  24. * @ORM\Column(type="string")
  25. * @Serializer\Type("string")
  26. * @var string
  27. */
  28. private $name;
  29. /**
  30. * Server constructor.
  31. * @param string $name
  32. * @param string $ipAddress
  33. * @param string $serverId
  34. */
  35. public function __construct($name, $ipAddress, $serverId)
  36. {
  37. $this->name = $name;
  38. $this->ipAddress = $ipAddress;
  39. $this->serverId = $serverId;
  40. }
  41. /**
  42. * @return string
  43. */
  44. public function getName()
  45. {
  46. return $this->name;
  47. }
  48. /**
  49. * @return string
  50. */
  51. public function getIpAddress()
  52. {
  53. return $this->ipAddress;
  54. }
  55. /**
  56. * @return string
  57. */
  58. public function getServerId()
  59. {
  60. return $this->serverId;
  61. }
  62. }