*/ declare(strict_types=1); namespace oat\ltiDeliveryProvider\model\options\DataAccess\Mapper; use oat\oatbox\service\ConfigurableService; use oat\taoQtiTest\models\runner\config\Business\Domain\Option; use oat\taoQtiTest\models\runner\config\Business\Domain\OptionCollection; class OptionCollectionMapper extends ConfigurableService { public const SERVICE_ID = 'ltiDeliveryProvider/OptionCollectionMapper'; public function toDomain(array $rawData): OptionCollection { $resultingOptions = []; foreach ($rawData as $tool => $status) { if (is_bool($status)) { $resultingOptions[] = new Option((string)$tool, $status); } } return new OptionCollection(...$resultingOptions); } }