您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

StopsLiteRoutesLiteDboArray.php 1.1KB

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