category_seo.php

Go to the documentation of this file.
00001 <?php
00002 
00006 class Category_Seo extends Object_Seo
00007 {
00008 
00014     public function save()
00015     {
00016         $sOxid = $this->getEditObjectId();
00017         $oCategory = oxNew('oxCategory');
00018         if ($oCategory->load($sOxid)) {
00019             $blShowSuffixParameter = oxRegistry::getConfig()->getRequestParameter('blShowSuffix');
00020             $sShowSuffixField = 'oxcategories__oxshowsuffix';
00021             $oCategory->$sShowSuffixField = new oxField((int) $blShowSuffixParameter);
00022             $oCategory->save();
00023 
00024             $this->_getEncoder()->markRelatedAsExpired($oCategory);
00025         }
00026 
00027         return parent::save();
00028     }
00029 
00035     protected function _getEncoder()
00036     {
00037         return oxRegistry::get("oxSeoEncoderCategory");
00038     }
00039 
00045     public function isSuffixSupported()
00046     {
00047         return true;
00048     }
00049 
00055     protected function _getType()
00056     {
00057         return 'oxcategory';
00058     }
00059 
00065     public function isEntrySuffixed()
00066     {
00067         $oCategory = oxNew('oxcategory');
00068         if ($oCategory->load($this->getEditObjectId())) {
00069             return (bool) $oCategory->oxcategories__oxshowsuffix->value;
00070         }
00071     }
00072 
00078     public function getEntryUri()
00079     {
00080         $oCategory = oxNew('oxcategory');
00081         if ($oCategory->load($this->getEditObjectId())) {
00082             return $this->_getEncoder()->getCategoryUri($oCategory, $this->getEditLang());
00083         }
00084     }
00085 }