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( 'oxbase' );
00017         $oCategory->init( 'oxcategories' );
00018         if ( $oCategory->load( $sOxid ) ) {
00019             $oCategory->oxcategories__oxshowsuffix = new oxField( (int) oxConfig::getParameter( 'blShowSuffix' ) );
00020             $oCategory->save();
00021 
00022             $this->_getEncoder()->markRelatedAsExpired( $oCategory );
00023         }
00024 
00025         return parent::save();
00026     }
00027 
00033     protected function _getEncoder()
00034     {
00035         return oxSeoEncoderCategory::getInstance();
00036     }
00037 
00043     public function isSuffixSupported()
00044     {
00045         return true;
00046     }
00047 
00053     protected function _getType()
00054     {
00055         return 'oxcategory';
00056     }
00057 
00063     public function isEntrySuffixed()
00064     {
00065         $oCategory = oxNew( 'oxcategory' );
00066         if ( $oCategory->load( $this->getEditObjectId() ) ) {
00067             return (bool) $oCategory->oxcategories__oxshowsuffix->value;
00068         }
00069     }
00070 
00076     public function getEntryUri()
00077     {
00078         $oCategory = oxNew( 'oxcategory' );
00079         if ( $oCategory->load( $this->getEditObjectId() ) ) {
00080             return $this->_getEncoder()->getCategoryUri( $oCategory, $this->getEditLang() );
00081         }
00082     }
00083 }