本文整理汇总了PHP中oxUBase::getDefaultSorting方法的典型用法代码示例。如果您正苦于以下问题:PHP oxUBase::getDefaultSorting方法的具体用法?PHP oxUBase::getDefaultSorting怎么用?PHP oxUBase::getDefaultSorting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oxUBase
的用法示例。
在下文中一共展示了oxUBase::getDefaultSorting方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDefaultSorting
/**
* Returns default category sorting for selected category
*
* @return array
*/
public function getDefaultSorting()
{
$sorting = parent::getDefaultSorting();
$activeCategory = $this->getActiveCategory();
if ($this->getListType() != 'search' && $activeCategory && $activeCategory instanceof oxCategory) {
if ($categorySorting = $activeCategory->getDefaultSorting()) {
$sortingDirection = $activeCategory->getDefaultSortingMode() ? "desc" : "asc";
$sorting = array('sortby' => $categorySorting, 'sortdir' => $sortingDirection);
}
}
return $sorting;
}
示例2: getDefaultSorting
/**
* Returns default category sorting for selected category
*
* @return array
*/
public function getDefaultSorting()
{
$sorting = parent::getDefaultSorting();
$category = $this->getActiveCategory();
if ($category && $category instanceof \OxidEsales\EshopCommunity\Application\Model\Category) {
if ($defaultSorting = $category->getDefaultSorting()) {
$articleViewName = getViewName('oxarticles');
$sortBy = $articleViewName . '.' . $defaultSorting;
$sortDirection = $category->getDefaultSortingMode() ? "desc" : "asc";
$sorting = array('sortby' => $sortBy, 'sortdir' => $sortDirection);
}
}
return $sorting;
}
示例3: getDefaultSorting
/**
* Returns default category sorting for selected category
*
* @return array
*/
public function getDefaultSorting()
{
$aSorting = parent::getDefaultSorting();
$oCategory = $this->getActiveCategory();
if ($this->getListType() != 'search' && $oCategory && $oCategory instanceof oxCategory) {
if ($sSortBy = $oCategory->getDefaultSorting()) {
$sSortDir = $oCategory->getDefaultSortingMode() ? "desc" : "asc";
$aSorting = array('sortby' => $sSortBy, 'sortdir' => $sSortDir);
}
}
return $aSorting;
}
示例4: getDefaultSorting
/**
* Returns default category sorting for selected category
*
* @return array
*/
public function getDefaultSorting()
{
$aSorting = parent::getDefaultSorting();
$oCategory = $this->getActiveCategory();
if ($oCategory && $oCategory instanceof oxCategory) {
if ($sDefaultSorting = $oCategory->getDefaultSorting()) {
$sArticleTable = getViewName('oxarticles');
$sSortBy = $sArticleTable . '.' . $sDefaultSorting;
$sSortDir = $oCategory->getDefaultSortingMode() ? "desc" : "asc";
$aSorting = array('sortby' => $sSortBy, 'sortdir' => $sSortDir);
}
}
return $aSorting;
}