OXID eShop CE  4.10.1
 All Classes Namespaces Files Functions Variables Pages
category_seo.php
Go to the documentation of this file.
1 <?php
2 
6 class Category_Seo extends Object_Seo
7 {
8 
14  public function save()
15  {
16  $sOxid = $this->getEditObjectId();
17  $oCategory = oxNew('oxCategory');
18  if ($oCategory->load($sOxid)) {
19  $blShowSuffixParameter = oxRegistry::getConfig()->getRequestParameter('blShowSuffix');
20  $sShowSuffixField = 'oxcategories__oxshowsuffix';
21  $oCategory->$sShowSuffixField = new oxField((int) $blShowSuffixParameter);
22  $oCategory->save();
23 
24  $this->_getEncoder()->markRelatedAsExpired($oCategory);
25  }
26 
27  return parent::save();
28  }
29 
35  protected function _getEncoder()
36  {
37  return oxRegistry::get("oxSeoEncoderCategory");
38  }
39 
45  public function isSuffixSupported()
46  {
47  return true;
48  }
49 
55  protected function _getType()
56  {
57  return 'oxcategory';
58  }
59 
65  public function isEntrySuffixed()
66  {
67  $oCategory = oxNew('oxcategory');
68  if ($oCategory->load($this->getEditObjectId())) {
69  return (bool) $oCategory->oxcategories__oxshowsuffix->value;
70  }
71  }
72 
78  public function getEntryUri()
79  {
80  $oCategory = oxNew('oxcategory');
81  if ($oCategory->load($this->getEditObjectId())) {
82  return $this->_getEncoder()->getCategoryUri($oCategory, $this->getEditLang());
83  }
84  }
85 }