| Conditions | 3 | 
| Paths | 3 | 
| Total Lines | 16 | 
| Code Lines | 8 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 21 | public static function save(\Mage_Core_Model_Abstract $product, array $gallery, $save = true)  | 
            ||
| 22 |     { | 
            ||
| 23 |         if (!@file_exists($gallery['image'])) { | 
            ||
| 24 | throw new ProductMediaGalleryImageNotFound(  | 
            ||
| 25 | 'Specified product fixture gallery image does not exists -> ' . $gallery['image']  | 
            ||
| 26 | );  | 
            ||
| 27 | }  | 
            ||
| 28 | |||
| 29 | $product->addImageToMediaGallery(  | 
            ||
| 30 | $gallery['image'], ['image', 'thumbnail', 'small_image'], false, false  | 
            ||
| 31 | );  | 
            ||
| 32 | |||
| 33 |         if ($save) { | 
            ||
| 34 | $product->save();  | 
            ||
| 35 | }  | 
            ||
| 36 | }  | 
            ||
| 37 | }  |