/** * Deletes manufacturer seo entry * * @param oxmanufacturer $oManufacturer Manufacturer object */ public function onDeleteManufacturer($oManufacturer) { $oDb = oxDb::getDb(); $sIdQuoted = $oDb->quote($oManufacturer->getId()); $oDb->execute("delete from oxseo where oxobjectid = {$sIdQuoted} and oxtype = 'oxmanufacturer'"); $oDb->execute("delete from oxobject2seodata where oxobjectid = {$sIdQuoted}"); }
/** * Loads and returns article list of active Manufacturer. * * @param oxmanufacturer $oManufacturer Manufacturer object * * @return array */ protected function _loadArticles($oManufacturer) { $sManufacturerId = $oManufacturer->getId(); // load only articles which we show on screen $iNrofCatArticles = (int) $this->getConfig()->getConfigParam('iNrofCatArticles'); $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1; $oArtList = oxNew('oxarticlelist'); $oArtList->setSqlLimit($iNrofCatArticles * $this->_getRequestPageNr(), $iNrofCatArticles); $oArtList->setCustomSorting($this->getSortingSql($sManufacturerId)); // load the articles $this->_iAllArtCnt = $oArtList->loadManufacturerArticles($sManufacturerId, $oManufacturer); // counting pages $this->_iCntPages = round($this->_iAllArtCnt / $iNrofCatArticles + 0.49); return array($oArtList, $this->_iAllArtCnt); }