public function SortedImages()
    {
        // If this product has images, display them
        if ($this->Images()->exists()) {
            return $this->Images()->Sort('SortOrder');
        }

        $config = SiteConfig::current_site_config();
        $default_image = $config->DefaultProductImage();
        $images = ArrayList::create();
        
        // Try to use default from SiteConfig, if none is available,
        // use a system default
        if ($default_image->exists()) {
            $image = $default_image;
        } else {
            $image = Helper::generate_no_image();
        }

        // Finally return a list with only the default
        $images->add($image);
        return $images;
    }
public function SortedImages()
    {
        // If this product has images, display them
        if ($this->Images()->exists()) {
            return $this->Images()->Sort('SortOrder');
        }

        $config = SiteConfig::current_site_config();
        $default_image = $config->DefaultProductImage();
        $images = ArrayList::create();
        
        // Try to use default from SiteConfig, if none is available,
        // use a system default
        if ($default_image->exists()) {
            $image = $default_image;
        } else {
            $image = Helper::generate_no_image();
        }

        // Finally return a list with only the default
        $images->add($image);
        return $images;
    }
public function SortedImages ( ) { // If this product has images, display them if ( $ this -> Images ( ) -> exists ( ) ) { return $ this -> Images ( ) -> Sort ( 'SortOrder' ) ; } $ config = SiteConfig :: current_site_config ( ) ; $ default_image = $ config -> DefaultProductImage ( ) ; $ images = ArrayList :: create ( ) ; // Try to use default from SiteConfig, if none is available, // use a system default if ( $ default_image -> exists ( ) ) { $ image = $ default_image ; } else { $ image = Helper :: generate_no_image ( ) ; } // Finally return a list with only the default $ images -> add ( $ image ) ; return $ images ; }
Return sorted images, if no images exist, create a new opbject set
with a blank product image in it.

@return SSList
Return sorted images if no images exist create a new opbject set with a blank product image in it .