OXID eShop CE  4.8.11
 All Classes 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 {
13  public function save()
14  {
15  $sOxid = $this->getEditObjectId();
16  $oCategory = oxNew( 'oxCategory' );
17  if ( $oCategory->load( $sOxid ) ) {
18  $oCategory->oxcategories__oxshowsuffix = new oxField( (int) oxConfig::getParameter( 'blShowSuffix' ) );
19  $oCategory->save();
20 
21  $this->_getEncoder()->markRelatedAsExpired( $oCategory );
22  }
23 
24  return parent::save();
25  }
26 
32  protected function _getEncoder()
33  {
34  return oxRegistry::get("oxSeoEncoderCategory");
35  }
36 
42  public function isSuffixSupported()
43  {
44  return true;
45  }
46 
52  protected function _getType()
53  {
54  return 'oxcategory';
55  }
56 
62  public function isEntrySuffixed()
63  {
64  $oCategory = oxNew( 'oxcategory' );
65  if ( $oCategory->load( $this->getEditObjectId() ) ) {
66  return (bool) $oCategory->oxcategories__oxshowsuffix->value;
67  }
68  }
69 
75  public function getEntryUri()
76  {
77  $oCategory = oxNew( 'oxcategory' );
78  if ( $oCategory->load( $this->getEditObjectId() ) ) {
79  return $this->_getEncoder()->getCategoryUri( $oCategory, $this->getEditLang() );
80  }
81  }
82 }