protected function iterate($value, PropertyDefinitionInterface $definition = null)
    {
        if (empty($value) || !is_array($value)) {
            return $value;
        }

        $type = $definition->getGenericType();

        foreach ($value as $key => $item) {
            if (is_null($item)) {
                continue;
            }

            $value[$key] = $this->castValue($item, $type);
        }

        return $value;
    }
protected function iterate($value, PropertyDefinitionInterface $definition = null)
    {
        if (empty($value) || !is_array($value)) {
            return $value;
        }

        $type = $definition->getGenericType();

        foreach ($value as $key => $item) {
            if (is_null($item)) {
                continue;
            }

            $value[$key] = $this->castValue($item, $type);
        }

        return $value;
    }
protected function iterate ( $ value , PropertyDefinitionInterface $ definition = null ) { if ( empty ( $ value ) || ! is_array ( $ value ) ) { return $ value ; } $ type = $ definition -> getGenericType ( ) ; foreach ( $ value as $ key => $ item ) { if ( is_null ( $ item ) ) { continue ; } $ value [ $ key ] = $ this -> castValue ( $ item , $ type ) ; } return $ value ; }
Attempte to iterate the value and cast all child items to the require generic type.

@param                             $value
@param PropertyDefinitionInterface $definition

@return array
Attempte to iterate the value and cast all child items to the require generic type .