|
@@ 147-153 (lines=7) @@
|
| 144 |
|
return $serialized; |
| 145 |
|
} |
| 146 |
|
|
| 147 |
|
foreach ($metadata->getAttributes() as $key => $attrMeta) { |
| 148 |
|
if (false === $attrMeta->shouldSerialize()) { |
| 149 |
|
continue; |
| 150 |
|
} |
| 151 |
|
$value = $model->get($key); |
| 152 |
|
$serialized['attributes'][$key] = $this->serializeAttribute($value, $attrMeta); |
| 153 |
|
} |
| 154 |
|
|
| 155 |
|
foreach ($metadata->getEmbeds() as $key => $embeddedPropMeta) { |
| 156 |
|
if (false === $attrMeta->shouldSerialize()) { |
|
@@ 155-161 (lines=7) @@
|
| 152 |
|
$serialized['attributes'][$key] = $this->serializeAttribute($value, $attrMeta); |
| 153 |
|
} |
| 154 |
|
|
| 155 |
|
foreach ($metadata->getEmbeds() as $key => $embeddedPropMeta) { |
| 156 |
|
if (false === $attrMeta->shouldSerialize()) { |
| 157 |
|
continue; |
| 158 |
|
} |
| 159 |
|
$value = $model->get($key); |
| 160 |
|
$serialized['attributes'][$key] = $this->serializeEmbed($value, $embeddedPropMeta); |
| 161 |
|
} |
| 162 |
|
|
| 163 |
|
$serialized['links'] = ['self' => $adapter->buildUrl($metadata, $model->getId())]; |
| 164 |
|
|