You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LuIntDboArray.php 924B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: robin
  5. * Date: 2/22/16
  6. * Time: 9:40 PM
  7. */
  8. namespace Luticate\Utils\Dbo;
  9. use Luticate\Utils\LuDbo;
  10. class LuIntDboArray extends LuDbo
  11. {
  12. /**
  13. * @var int[]
  14. */
  15. protected $_array;
  16. public function getArray()
  17. {
  18. return $this->_array;
  19. }
  20. public function setArray($value)
  21. {
  22. $this->_array = $value;
  23. }
  24. public function jsonSerialize()
  25. {
  26. return $this->_array;
  27. }
  28. public static function jsonDeserialize($json)
  29. {
  30. $dbo = new LuIntDboArray();
  31. $array = [];
  32. foreach ($json as $data) {
  33. $array[] = LuIntDbo::jsonDeserialize($data)->getInt();
  34. }
  35. $dbo->setArray($array);
  36. return $dbo;
  37. }
  38. public static function generateSample()
  39. {
  40. return [
  41. LuIntDbo::generateSample(),
  42. LuIntDbo::generateSample()
  43. ];
  44. }
  45. }