/** * Returns Manufacturer SEO url for specified page * * @param oxManufacturer $oManufacturer manufacturer object * @param int $iPage page tu prepare number * @param int $iLang language * @param bool $blFixed fixed url marker (default is null) * * @return string */ public function getManufacturerPageUrl($oManufacturer, $iPage, $iLang = null, $blFixed = null) { if (!isset($iLang)) { $iLang = $oManufacturer->getLanguage(); } $sStdUrl = $oManufacturer->getBaseStdLink($iLang) . '&pgNr=' . $iPage; $sParams = $sParams = (int) ($iPage + 1); $sStdUrl = $this->_trimUrl($sStdUrl, $iLang); $sSeoUrl = $this->getManufacturerUri($oManufacturer, $iLang) . $sParams . "/"; if ($blFixed === null) { $blFixed = $this->_isFixed('oxmanufacturers', $oManufacturer->getId(), $iLang); } return $this->_getFullUrl($this->_getPageUri($oManufacturer, 'oxmanufacturers', $sStdUrl, $sSeoUrl, $sParams, $iLang, $blFixed), $iLang); }
/** * 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}"); $oDb->execute("delete from oxseohistory 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($this->getSortIdent())); // load the articles $this->_iAllArtCnt = $oArtList->loadManufacturerArticles($sManufacturerId, $oManufacturer); // counting pages $this->_iCntPages = round($this->_iAllArtCnt / $iNrofCatArticles + 0.49); return array($oArtList, $this->_iAllArtCnt); }
/** * @param oxManufacturer $oManufacturer */ protected function updateManufacturerBeforeLoading($oManufacturer) { $oManufacturer->setReadOnly(true); }