NumberValue.php 523 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Aws\DynamoDb;
  3. /**
  4. * Special object to represent a DynamoDB Number (N) value.
  5. */
  6. class NumberValue implements \JsonSerializable
  7. {
  8. /** @var string Number value. */
  9. private $value;
  10. /**
  11. * @param string|int|float $value A number value.
  12. */
  13. public function __construct($value)
  14. {
  15. $this->value = (string) $value;
  16. }
  17. public function jsonSerialize()
  18. {
  19. return $this->value;
  20. }
  21. public function __toString()
  22. {
  23. return $this->value;
  24. }
  25. }