OXID eShop CE  4.9.10
 All Classes Files Functions Variables Pages
oxseoencoderrecomm.php
Go to the documentation of this file.
1 <?php
2 
8 {
9 
18  public function getRecommUri($oRecomm, $iLang = null)
19  {
20  if (!($sSeoUrl = $this->_loadFromDb('dynamic', $oRecomm->getId(), $iLang))) {
21  $myConfig = $this->getConfig();
22 
23  // fetching part of base url
24  $sSeoUrl = $this->_getStaticUri(
25  $oRecomm->getBaseStdLink($iLang, false),
26  $myConfig->getShopId(),
27  $iLang
28  )
29  . $this->_prepareTitle($oRecomm->oxrecommlists__oxtitle->value, false, $iLang);
30 
31  // creating unique
32  $sSeoUrl = $this->_processSeoUrl($sSeoUrl, $oRecomm->getId(), $iLang);
33 
34  // inserting
35  $this->_saveToDb('dynamic', $oRecomm->getId(), $oRecomm->getBaseStdLink($iLang), $sSeoUrl, $iLang, $myConfig->getShopId());
36  }
37 
38  return $sSeoUrl;
39  }
40 
49  public function getRecommUrl($oRecomm, $iLang = null)
50  {
51  if (!isset($iLang)) {
52  $iLang = oxRegistry::getLang()->getBaseLanguage();
53  }
54 
55  return $this->_getFullUrl($this->getRecommUri($oRecomm, $iLang), $iLang);
56  }
57 
68  public function getRecommPageUrl($oRecomm, $iPage, $iLang = null, $blFixed = false)
69  {
70  if (!isset($iLang)) {
71  $iLang = oxRegistry::getLang()->getBaseLanguage();
72  }
73  $sStdUrl = $oRecomm->getBaseStdLink($iLang) . '&amp;pgNr=' . $iPage;
74  $sParams = (int) ($iPage + 1);
75 
76  $sStdUrl = $this->_trimUrl($sStdUrl, $iLang);
77  $sSeoUrl = $this->getRecommUri($oRecomm, $iLang) . $sParams . "/";
78 
79  return $this->_getFullUrl($this->_getPageUri($oRecomm, 'dynamic', $sStdUrl, $sSeoUrl, $sParams, $iLang, $blFixed), $iLang);
80  }
81 }