OXID eShop CE  4.10.2
 All Classes Namespaces Files Functions Variables Pages
oxseoencoderrecomm.php
Go to the documentation of this file.
1 <?php
2 
9 {
10 
21  public function getRecommUri($oRecomm, $iLang = null)
22  {
23  if (!($sSeoUrl = $this->_loadFromDb('dynamic', $oRecomm->getId(), $iLang))) {
24  $myConfig = $this->getConfig();
25 
26  // fetching part of base url
27  $sSeoUrl = $this->_getStaticUri(
28  $oRecomm->getBaseStdLink($iLang, false),
29  $myConfig->getShopId(),
30  $iLang
31  )
32  . $this->_prepareTitle($oRecomm->oxrecommlists__oxtitle->value, false, $iLang);
33 
34  // creating unique
35  $sSeoUrl = $this->_processSeoUrl($sSeoUrl, $oRecomm->getId(), $iLang);
36 
37  // inserting
38  $this->_saveToDb('dynamic', $oRecomm->getId(), $oRecomm->getBaseStdLink($iLang), $sSeoUrl, $iLang, $myConfig->getShopId());
39  }
40 
41  return $sSeoUrl;
42  }
43 
54  public function getRecommUrl($oRecomm, $iLang = null)
55  {
56  if (!isset($iLang)) {
57  $iLang = oxRegistry::getLang()->getBaseLanguage();
58  }
59 
60  return $this->_getFullUrl($this->getRecommUri($oRecomm, $iLang), $iLang);
61  }
62 
75  public function getRecommPageUrl($oRecomm, $iPage, $iLang = null, $blFixed = false)
76  {
77  if (!isset($iLang)) {
78  $iLang = oxRegistry::getLang()->getBaseLanguage();
79  }
80  $sStdUrl = $oRecomm->getBaseStdLink($iLang) . '&amp;pgNr=' . $iPage;
81  $sParams = (int) ($iPage + 1);
82 
83  $sStdUrl = $this->_trimUrl($sStdUrl, $iLang);
84  $sSeoUrl = $this->getRecommUri($oRecomm, $iLang) . $sParams . "/";
85 
86  return $this->_getFullUrl($this->_getPageUri($oRecomm, 'dynamic', $sStdUrl, $sSeoUrl, $sParams, $iLang, $blFixed), $iLang);
87  }
88 }