source/Application/Controller/Admin/ArticlePictures.php
protected function _resetMasterPicture($oArticle, $iIndex, $blDeleteMaster = false)
    {
        if ($this->canResetMasterPicture($oArticle, $iIndex)) {
            if (!$oArticle->isDerived()) {
                $oPicHandler = \OxidEsales\Eshop\Core\Registry::getPictureHandler();
                $oPicHandler->deleteArticleMasterPicture($oArticle, $iIndex, $blDeleteMaster);
            }

            if ($blDeleteMaster) {
                //reseting master picture field
                $oArticle->{"oxarticles__oxpic" . $iIndex} = new \OxidEsales\Eshop\Core\Field();
            }

            // cleaning oxzoom fields
            if (isset($oArticle->{"oxarticles__oxzoom" . $iIndex})) {
                $oArticle->{"oxarticles__oxzoom" . $iIndex} = new \OxidEsales\Eshop\Core\Field();
            }

            if ($iIndex == 1) {
                $this->_cleanupCustomFields($oArticle);
            }
        }
    }
protected function _resetMasterPicture($oArticle, $iIndex, $blDeleteMaster = false)
    {
        if ($this->canResetMasterPicture($oArticle, $iIndex)) {
            if (!$oArticle->isDerived()) {
                $oPicHandler = \OxidEsales\Eshop\Core\Registry::getPictureHandler();
                $oPicHandler->deleteArticleMasterPicture($oArticle, $iIndex, $blDeleteMaster);
            }

            if ($blDeleteMaster) {
                //reseting master picture field
                $oArticle->{"oxarticles__oxpic" . $iIndex} = new \OxidEsales\Eshop\Core\Field();
            }

            // cleaning oxzoom fields
            if (isset($oArticle->{"oxarticles__oxzoom" . $iIndex})) {
                $oArticle->{"oxarticles__oxzoom" . $iIndex} = new \OxidEsales\Eshop\Core\Field();
            }

            if ($iIndex == 1) {
                $this->_cleanupCustomFields($oArticle);
            }
        }
    }
protected function _resetMasterPicture ( $ oArticle , $ iIndex , $ blDeleteMaster = false ) { if ( $ this -> canResetMasterPicture ( $ oArticle , $ iIndex ) ) { if ( ! $ oArticle -> isDerived ( ) ) { $ oPicHandler = \ OxidEsales \ Eshop \ Core \ Registry :: getPictureHandler ( ) ; $ oPicHandler -> deleteArticleMasterPicture ( $ oArticle , $ iIndex , $ blDeleteMaster ) ; } if ( $ blDeleteMaster ) { //reseting master picture field $ oArticle -> { "oxarticles__oxpic" . $ iIndex } = new \ OxidEsales \ Eshop \ Core \ Field ( ) ; } // cleaning oxzoom fields if ( isset ( $ oArticle -> { "oxarticles__oxzoom" . $ iIndex } ) ) { $ oArticle -> { "oxarticles__oxzoom" . $ iIndex } = new \ OxidEsales \ Eshop \ Core \ Field ( ) ; } if ( $ iIndex == 1 ) { $ this -> _cleanupCustomFields ( $ oArticle ) ; } } }
Deletes selected master picture and all pictures generated
from master picture

@param \OxidEsales\Eshop\Application\Model\Article $oArticle       article object
@param int                                         $iIndex         master picture index
@param bool                                        $blDeleteMaster if TRUE - deletes and unsets master image file
Deletes selected master picture and all pictures generated from master picture