fix: content type
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -43,7 +43,11 @@ class CollectionProperties extends CollectionPropertiesMutableAbstract {
|
|||||||
$this->data[self::PROPERTY_COLOR] = $data['color'];
|
$this->data[self::PROPERTY_COLOR] = $data['color'];
|
||||||
}
|
}
|
||||||
if (isset($data['content'])) {
|
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;
|
return $this;
|
||||||
@@ -61,7 +65,7 @@ class CollectionProperties extends CollectionPropertiesMutableAbstract {
|
|||||||
'rank' => $this->getRank(),
|
'rank' => $this->getRank(),
|
||||||
'visibility' => $this->getVisibility(),
|
'visibility' => $this->getVisibility(),
|
||||||
'color' => $this->getColor(),
|
'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);
|
], static fn($value) => $value !== null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ declare(strict_types=1);
|
|||||||
namespace KTXM\ProviderLocalPeople\Providers\Personal;
|
namespace KTXM\ProviderLocalPeople\Providers\Personal;
|
||||||
|
|
||||||
use KTXF\People\Entity\EntityMutableAbstract;
|
use KTXF\People\Entity\EntityMutableAbstract;
|
||||||
use KTXF\People\Entity\Individual\IndividualObject;
|
use KTXF\People\Entity\IndividualObject;
|
||||||
|
|
||||||
class EntityResource extends EntityMutableAbstract {
|
class EntityResource extends EntityMutableAbstract {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user