_getMatchesModel()->getCollection() ->addFieldToFilter("product_id", $productId); return $collection; } public function getImagesUrlByProductId($productId, $size = "full", $keepFrame = false) { $productId = (int)$productId; $collection = $this->_getMatchesModel()->getCollection(); $collection->addFieldToFilter('product_id',$productId); if($size == ""){ $size = null; } foreach($collection as $value){ $optionId = $value->getOptionId(); $valueId = $value->getValueId(); $image = $value->getImage(); $this->_getHelperImages()->getFullImageUrl( $productId, $optionId, $image, Mage::getStoreConfig('colorpicker_section/developer_tools/zoom_image_width') ); $matches[$optionId][$valueId] = $this->_getHelperImages()->getFullImageUrl( $productId, $optionId, $image, $size, $keepFrame ); $matches['matches'][$optionId][$valueId] = $value->getMatchId(); } return empty($matches) ? false : $matches; } /** * @param array $matchesId * @return $this */ public function deleteImages($matchesId) { foreach ($matchesId as $matchId=>$status) { $this->_getMatchesModel() ->load($matchId) ->delete(); } return $this; } }