ShippingExperience.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. namespace Temando\Shipping\Model\Order;
  6. use Temando\Shipping\Api\Data\Order\ShippingExperienceInterface;
  7. /**
  8. * Shipping Experience as selected during checkout, used during REST API access
  9. *
  10. * @package Temando\Shipping\Model
  11. * @author Christoph Aßmann <christoph.assmann@netresearch.de>
  12. * @author Sebastian Ertner <sebastian.ertner@netresearch.de>
  13. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  14. * @link http://www.temando.com/
  15. */
  16. class ShippingExperience implements ShippingExperienceInterface, \JsonSerializable
  17. {
  18. /**
  19. * @var string
  20. */
  21. private $label;
  22. /**
  23. * @var string
  24. */
  25. private $code;
  26. /**
  27. * @var float
  28. */
  29. private $cost;
  30. /**
  31. * ShippingExperience constructor.
  32. * @param string $label
  33. * @param string $code
  34. * @param float $cost
  35. */
  36. public function __construct($label, $code, $cost)
  37. {
  38. $this->label = $label;
  39. $this->code = $code;
  40. $this->cost = $cost;
  41. }
  42. /**
  43. * @return string
  44. */
  45. public function getLabel()
  46. {
  47. return $this->label;
  48. }
  49. /**
  50. * @param string $label
  51. * @return void
  52. */
  53. public function setLabel($label)
  54. {
  55. $this->label = $label;
  56. }
  57. /**
  58. * @return string
  59. */
  60. public function getCode()
  61. {
  62. return $this->code;
  63. }
  64. /**
  65. * @param string $code
  66. * @return void
  67. */
  68. public function setCode($code)
  69. {
  70. $this->code = $code;
  71. }
  72. /**
  73. * @return float
  74. */
  75. public function getCost()
  76. {
  77. return $this->cost;
  78. }
  79. /**
  80. * @param float $cost
  81. * @return void
  82. */
  83. public function setCost($cost)
  84. {
  85. $this->cost = $cost;
  86. }
  87. /**
  88. * Obtain serialized representation of a shipping experience.
  89. *
  90. * @return string[]
  91. */
  92. public function jsonSerialize()
  93. {
  94. $properties = get_object_vars($this);
  95. return $properties;
  96. }
  97. }