protected function unshiftSelectedImageProduct($selected, &$product)
    {
        if (isset($selected['combination']['file_id']) && isset($product['images'][$selected['combination']['file_id']])) {
            $image = $product['images'][$selected['combination']['file_id']];
            unset($product['images'][$selected['combination']['file_id']]);
            $product['images'] = array($image['file_id'] => $image) + $product['images'];
        }
    }
protected function unshiftSelectedImageProduct($selected, &$product)
    {
        if (isset($selected['combination']['file_id']) && isset($product['images'][$selected['combination']['file_id']])) {
            $image = $product['images'][$selected['combination']['file_id']];
            unset($product['images'][$selected['combination']['file_id']]);
            $product['images'] = array($image['file_id'] => $image) + $product['images'];
        }
    }
protected function unshiftSelectedImageProduct ( $ selected , & $ product ) { if ( isset ( $ selected [ 'combination' ] [ 'file_id' ] ) && isset ( $ product [ 'images' ] [ $ selected [ 'combination' ] [ 'file_id' ] ] ) ) { $ image = $ product [ 'images' ] [ $ selected [ 'combination' ] [ 'file_id' ] ] ; unset ( $ product [ 'images' ] [ $ selected [ 'combination' ] [ 'file_id' ] ] ) ; $ product [ 'images' ] = array ( $ image [ 'file_id' ] => $ image ) + $ product [ 'images' ] ; } }
Put default selected image on the first position
@param array $selected
@param array $product
@todo Replace with a trait
Put default selected image on the first position