app/code/community/Nexcessnet/Turpentine/Model/Observer/Ban.php
public function banProductReview($eventObject) {
        if (Mage::helper('turpentine/varnish')->getVarnishEnabled()) {
            $patterns = array();
            /* @var $review \Mage_Review_Model_Review*/
            $review = $eventObject->getObject();

            /* @var $productCollection \Mage_Review_Model_Resource_Review_Product_Collection*/
            $productCollection = $review->getProductCollection();

            $products = $productCollection->addEntityFilter((int) $review->getEntityPkValue())->getItems();

            $productIds = array_unique(array_map(
                create_function('$p', 'return $p->getEntityId();'),
                $products ));
            $patterns[] = sprintf('/review/product/list/id/(?:%s)/category/',
                implode('|', array_unique($productIds)));
            $patterns[] = sprintf('/review/product/view/id/%d/',
                $review->getEntityId());
            $productPatterns = array();
            foreach ($products as $p) {
                $urlKey = $p->getUrlModel()->formatUrlKey($p->getName());
                if ($urlKey) {
                    $productPatterns[] = $urlKey;
                }
            }
            if ( ! empty($productPatterns)) {
                $productPatterns = array_unique($productPatterns);
                $patterns[] = sprintf('(?:%s)', implode('|', $productPatterns));
            }
            $urlPattern = implode('|', $patterns);

            $result = $this->_getVarnishAdmin()->flushUrl($urlPattern);
            return $this->_checkResult($result);
        }
    }
public function banProductReview($eventObject) {
        if (Mage::helper('turpentine/varnish')->getVarnishEnabled()) {
            $patterns = array();
            /* @var $review \Mage_Review_Model_Review*/
            $review = $eventObject->getObject();

            /* @var $productCollection \Mage_Review_Model_Resource_Review_Product_Collection*/
            $productCollection = $review->getProductCollection();

            $products = $productCollection->addEntityFilter((int) $review->getEntityPkValue())->getItems();

            $productIds = array_unique(array_map(
                create_function('$p', 'return $p->getEntityId();'),
                $products ));
            $patterns[] = sprintf('/review/product/list/id/(?:%s)/category/',
                implode('|', array_unique($productIds)));
            $patterns[] = sprintf('/review/product/view/id/%d/',
                $review->getEntityId());
            $productPatterns = array();
            foreach ($products as $p) {
                $urlKey = $p->getUrlModel()->formatUrlKey($p->getName());
                if ($urlKey) {
                    $productPatterns[] = $urlKey;
                }
            }
            if ( ! empty($productPatterns)) {
                $productPatterns = array_unique($productPatterns);
                $patterns[] = sprintf('(?:%s)', implode('|', $productPatterns));
            }
            $urlPattern = implode('|', $patterns);

            $result = $this->_getVarnishAdmin()->flushUrl($urlPattern);
            return $this->_checkResult($result);
        }
    }
public function banProductReview ( $ eventObject ) { if ( Mage :: helper ( 'turpentine/varnish' ) -> getVarnishEnabled ( ) ) { $ patterns = array ( ) ; /* @var $review \Mage_Review_Model_Review*/ $ review = $ eventObject -> getObject ( ) ; /* @var $productCollection \Mage_Review_Model_Resource_Review_Product_Collection*/ $ productCollection = $ review -> getProductCollection ( ) ; $ products = $ productCollection -> addEntityFilter ( ( int ) $ review -> getEntityPkValue ( ) ) -> getItems ( ) ; $ productIds = array_unique ( array_map ( create_function ( '$p' , 'return $p->getEntityId();' ) , $ products ) ) ; $ patterns [ ] = sprintf ( '/review/product/list/id/(?:%s)/category/' , implode ( '|' , array_unique ( $ productIds ) ) ) ; $ patterns [ ] = sprintf ( '/review/product/view/id/%d/' , $ review -> getEntityId ( ) ) ; $ productPatterns = array ( ) ; foreach ( $ products as $ p ) { $ urlKey = $ p -> getUrlModel ( ) -> formatUrlKey ( $ p -> getName ( ) ) ; if ( $ urlKey ) { $ productPatterns [ ] = $ urlKey ; } } if ( ! empty ( $ productPatterns ) ) { $ productPatterns = array_unique ( $ productPatterns ) ; $ patterns [ ] = sprintf ( '(?:%s)' , implode ( '|' , $ productPatterns ) ) ; } $ urlPattern = implode ( '|' , $ patterns ) ; $ result = $ this -> _getVarnishAdmin ( ) -> flushUrl ( $ urlPattern ) ; return $ this -> _checkResult ( $ result ) ; } }
Ban a product's reviews page

@param  Varien_Object $eventObject
@return bool
Ban a product s reviews page