|
@@ 93-100 (lines=8) @@
|
| 90 |
|
*/ |
| 91 |
|
protected function serializeObject($value) |
| 92 |
|
{ |
| 93 |
|
if ($value instanceof \Illuminate\Database\Eloquent\Collection) { |
| 94 |
|
$items = []; |
| 95 |
|
foreach ($value as $v) { |
| 96 |
|
$items[] = $this->serializeObject($v); |
| 97 |
|
} |
| 98 |
|
|
| 99 |
|
return [self::MAP_TYPE => 'array', self::SCALAR_VALUE => $items]; |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
if ($value instanceof \Illuminate\Contracts\Pagination\Paginator) { |
| 103 |
|
$items = []; |
|
@@ 102-109 (lines=8) @@
|
| 99 |
|
return [self::MAP_TYPE => 'array', self::SCALAR_VALUE => $items]; |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
if ($value instanceof \Illuminate\Contracts\Pagination\Paginator) { |
| 103 |
|
$items = []; |
| 104 |
|
foreach ($value->items() as $v) { |
| 105 |
|
$items[] = $this->serializeObject($v); |
| 106 |
|
} |
| 107 |
|
|
| 108 |
|
return [self::MAP_TYPE => 'array', self::SCALAR_VALUE => $items]; |
| 109 |
|
} |
| 110 |
|
|
| 111 |
|
if (\is_subclass_of($value, Model::class, true)) { |
| 112 |
|
$stdClass = (object) $value->attributesToArray(); |