category_seo.php

Go to the documentation of this file.
00001 <?php
00002 
00006 class Category_Seo extends Object_Seo
00007 {
00013     public function save()
00014     {
00015         $sOxid = $this->getEditObjectId();
00016         $oCategory = oxNew( 'oxCategory' );
00017         if ( $oCategory->load( $sOxid ) ) {
00018             $oCategory->oxcategories__oxshowsuffix = new oxField( (int) oxConfig::getParameter( 'blShowSuffix' ) );
00019             $oCategory->save();
00020 
00021             $this->_getEncoder()->markRelatedAsExpired( $oCategory );
00022         }
00023 
00024         return parent::save();
00025     }
00026 
00032     protected function _getEncoder()
00033     {
00034         return oxRegistry::get("oxSeoEncoderCategory");
00035     }
00036 
00042     public function isSuffixSupported()
00043     {
00044         return true;
00045     }
00046 
00052     protected function _getType()
00053     {
00054         return 'oxcategory';
00055     }
00056 
00062     public function isEntrySuffixed()
00063     {
00064         $oCategory = oxNew( 'oxcategory' );
00065         if ( $oCategory->load( $this->getEditObjectId() ) ) {
00066             return (bool) $oCategory->oxcategories__oxshowsuffix->value;
00067         }
00068     }
00069 
00075     public function getEntryUri()
00076     {
00077         $oCategory = oxNew( 'oxcategory' );
00078         if ( $oCategory->load( $this->getEditObjectId() ) ) {
00079             return $this->_getEncoder()->getCategoryUri( $oCategory, $this->getEditLang() );
00080         }
00081     }
00082 }