| @@ 58-65 (lines=8) @@ | ||
| 55 | */ |
|
| 56 | public function mergeMetadata(ObjectMetadataInterface $metadata = null) |
|
| 57 | { |
|
| 58 | if (null === $metadata) { |
|
| 59 | return $this; |
|
| 60 | } elseif (!$metadata instanceof ObjectMetadataInterface) { |
|
| 61 | throw new \InvalidArgumentException(sprintf( |
|
| 62 | "Couldn't merge metadata from %s instance", |
|
| 63 | get_class($metadata) |
|
| 64 | )); |
|
| 65 | } |
|
| 66 | ||
| 67 | $this->properties = array_merge($this->properties, $metadata->getProperties()); |
|
| 68 | ||
| @@ 114-121 (lines=8) @@ | ||
| 111 | */ |
|
| 112 | public function mergeMetadata(ResourceMetadataInterface $metadata = null) |
|
| 113 | { |
|
| 114 | if (null === $metadata) { |
|
| 115 | return $this; |
|
| 116 | } elseif (!$metadata instanceof ResourceMetadataInterface) { |
|
| 117 | throw new \InvalidArgumentException(sprintf( |
|
| 118 | "Couldn't merge metadata from %s instance", |
|
| 119 | get_class($metadata) |
|
| 120 | )); |
|
| 121 | } |
|
| 122 | ||
| 123 | $this->attributes = array_merge($this->attributes, $metadata->getAttributes()); |
|
| 124 | $this->relationships = array_merge($this->relationships, $metadata->getRelationships()); |
|