Skip to content

Commit

Permalink
feat: import export bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian ALEXANDRE committed Jun 5, 2024
1 parent fa456e4 commit ebbdcc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace AlmaviaCX\Bundle\IbexaImportExport\Accessor\Ibexa\Content\Field\ValueTransformer;

use AlmaviaCX\Bundle\IbexaImportExport\Accessor\Ibexa\Content\ContentAccessor;
use AlmaviaCX\Bundle\IbexaImportExport\Accessor\Ibexa\Content\ContentAccessorBuilder;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition;
Expand All @@ -19,10 +20,7 @@ public function __construct(
$this->contentAccessorBuilder = $contentAccessorBuilder;
}

/**
* @return \AlmaviaCX\Bundle\IbexaImportExport\Accessor\Ibexa\Content\ContentAccessor|null
*/
public function __invoke(Field $field, FieldDefinition $fieldDefinition)
public function __invoke(Field $field, FieldDefinition $fieldDefinition): ?ContentAccessor
{
/** @var RelationValue $fieldValue */
$fieldValue = $field->getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ class SelectionFieldValueTransformer implements FieldValueTransformerInterface
public function __invoke(Field $field, FieldDefinition $fieldDefinition): array
{
$fieldValue = $field->getValue();
$selectedValues = array_intersect_key(

return array_intersect_key(
$fieldDefinition->fieldSettings['options'],
array_flip($fieldValue->selection)
);

return $selectedValues;
}
}

0 comments on commit ebbdcc4

Please sign in to comment.