src/DataStore/src/DataStore/Aspect/AspectTyped.php
protected function arrayToDto(array $itemData)
    {
        foreach ($itemData as $field => $value) {
            if (!isset($this->scheme[$field])) {
                throw new InvalidArgumentException("Undefined field '$field' in scheme");
            }

            $typeService = $this->scheme[$field]['type'];
            $itemData[$field] = $this->typePluginManager->get($typeService, ['value' => $value]);
        }

        return new $this->dtoClassName($itemData);
    }
protected function arrayToDto(array $itemData)
    {
        foreach ($itemData as $field => $value) {
            if (!isset($this->scheme[$field])) {
                throw new InvalidArgumentException("Undefined field '$field' in scheme");
            }

            $typeService = $this->scheme[$field]['type'];
            $itemData[$field] = $this->typePluginManager->get($typeService, ['value' => $value]);
        }

        return new $this->dtoClassName($itemData);
    }
protected function arrayToDto ( array $ itemData ) { foreach ( $ itemData as $ field => $ value ) { if ( ! isset ( $ this -> scheme [ $ field ] ) ) { throw new InvalidArgumentException ( "Undefined field '$field' in scheme" ) ; } $ typeService = $ this -> scheme [ $ field ] [ 'type' ] ; $ itemData [ $ field ] = $ this -> typePluginManager -> get ( $ typeService , [ 'value' => $ value ] ) ; } return new $ this -> dtoClassName ( $ itemData ) ; }
Convert array to BaseDto object

@param array $itemData
@return BaseDto
Convert array to BaseDto object