| @@ 121-130 (lines=10) @@ | ||
| 118 | * |
|
| 119 | * @return array |
|
| 120 | */ |
|
| 121 | public function asArray() |
|
| 122 | { |
|
| 123 | return array_map(function ($value) { |
|
| 124 | if ($value instanceof GraphNode || $value instanceof GraphEdge) { |
|
| 125 | return $value->asArray(); |
|
| 126 | } |
|
| 127 | ||
| 128 | return $value; |
|
| 129 | }, $this->items); |
|
| 130 | } |
|
| 131 | ||
| 132 | /** |
|
| 133 | * {@inheritdoc} |
|
| @@ 94-103 (lines=10) @@ | ||
| 91 | * |
|
| 92 | * @return array |
|
| 93 | */ |
|
| 94 | public function asArray() |
|
| 95 | { |
|
| 96 | return array_map(function ($value) { |
|
| 97 | if ($value instanceof GraphNode || $value instanceof GraphEdge) { |
|
| 98 | return $value->asArray(); |
|
| 99 | } |
|
| 100 | ||
| 101 | return $value; |
|
| 102 | }, $this->fields); |
|
| 103 | } |
|
| 104 | ||
| 105 | /** |
|
| 106 | * Convert the collection to its string representation. |
|