vendor_seo.php

Go to the documentation of this file.
00001 <?php
00002 
00006 class Vendor_Seo extends Object_Seo
00007 {
00015     public function render()
00016     {
00017         $this->_aViewData['blShowSuffixEdit'] = true;
00018         $this->_aViewData['blShowSuffix'] = $this->_getObject( oxConfig::getParameter( 'oxid' ) )->oxvendor__oxshowsuffix->value;
00019 
00020         return parent::render();
00021     }
00022 
00032     protected function _getSeoDataSql( $oObject, $iShopId, $iLang )
00033     {
00034         return parent::_getSeoDataSql( $oObject, $iShopId, $iLang )." and oxparams = '' ";
00035     }
00036 
00044     protected function _getSeoUrl( $oVendor )
00045     {
00046         $this->_getEncoder()->getVendorUrl( $oVendor );
00047         return parent::_getSeoUrl( $oVendor );
00048     }
00049 
00057     protected function _getObject( $sOxid )
00058     {
00059         // load object
00060         $oVendor = oxNew( 'oxvendor' );
00061         if ( $oVendor->loadInLang( $this->_iEditLang, $sOxid ) ) {
00062             return $oVendor;
00063         }
00064     }
00065 
00071     protected function _getType()
00072     {
00073         return 'oxvendor';
00074     }
00075 
00081     public function save()
00082     {
00083         if ( $sOxid = oxConfig::getParameter( 'oxid' ) ) {
00084             $oVendor = oxNew( 'oxbase' );
00085             $oVendor->init( 'oxvendor' );
00086             if ( $oVendor->load( $sOxid ) ) {
00087                 $oVendor->oxvendor__oxshowsuffix = new oxField( (int) oxConfig::getParameter( 'blShowSuffix' ) );
00088                 $oVendor->save();
00089             }
00090         }
00091 
00092         return parent::save();
00093     }
00094 
00100     protected function _getEncoder()
00101     {
00102         return oxSeoEncoderVendor::getInstance();
00103     }
00104 }