diff --git a/lib/Providers/Personal/CollectionProperties.php b/lib/Providers/Personal/CollectionProperties.php index 02d7a0e..b1c90a3 100644 --- a/lib/Providers/Personal/CollectionProperties.php +++ b/lib/Providers/Personal/CollectionProperties.php @@ -43,7 +43,11 @@ class CollectionProperties extends CollectionPropertiesMutableAbstract { $this->data[self::PROPERTY_COLOR] = $data['color']; } if (isset($data['content'])) { - $this->data[self::PROPERTY_CONTENT] = (string) $data['content']; + $content = is_array($data['content']) ? $data['content'] : [$data['content']]; + $this->data[self::PROPERTY_CONTENT] = array_values(array_map( + static fn($item) => $item instanceof CollectionContent ? $item->value : (string) $item, + $content + )); } return $this; @@ -61,7 +65,7 @@ class CollectionProperties extends CollectionPropertiesMutableAbstract { 'rank' => $this->getRank(), 'visibility' => $this->getVisibility(), 'color' => $this->getColor(), - 'content' => $content instanceof CollectionContent ? $content->value : null, + 'content' => $content !== [] ? array_map(static fn(CollectionContent $item) => $item->value, $content) : null, ], static fn($value) => $value !== null); } } diff --git a/lib/Providers/Personal/EntityResource.php b/lib/Providers/Personal/EntityResource.php index 666654a..8be6ebe 100644 --- a/lib/Providers/Personal/EntityResource.php +++ b/lib/Providers/Personal/EntityResource.php @@ -10,7 +10,7 @@ declare(strict_types=1); namespace KTXM\ProviderLocalPeople\Providers\Personal; use KTXF\People\Entity\EntityMutableAbstract; -use KTXF\People\Entity\Individual\IndividualObject; +use KTXF\People\Entity\IndividualObject; class EntityResource extends EntityMutableAbstract {