本文整理汇总了PHP中AbstractEntity::setSort方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractEntity::setSort方法的具体用法?PHP AbstractEntity::setSort怎么用?PHP AbstractEntity::setSort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractEntity
的用法示例。
在下文中一共展示了AbstractEntity::setSort方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setSort
protected function setSort()
{
if (!empty($_REQUEST['sort']) && !empty($_REQUEST['dir'])) {
$this->sortDirection = $this->getDb()->escapeStr($_REQUEST['dir']);
$sort = $this->getDb()->escapeStr($_REQUEST['sort']);
switch ($sort) {
case 'carrier_title':
$this->sortTable = 'carriers';
$this->sortField = 'title';
break;
default:
parent::setSort();
break;
}
}
}
示例2: setSort
protected function setSort()
{
if (!empty($_REQUEST['sort']) && !empty($_REQUEST['dir'])) {
$this->sortDirection = $this->getDb()->escapeStr($_REQUEST['dir']);
$sort = $this->getDb()->escapeStr($_REQUEST['sort']);
switch ($sort) {
case 'product_group':
$this->sortTable = 'product_groups';
$this->sortField = 'title';
break;
case 'store':
$this->sortTable = 'aff_stores';
$this->sortField = 'title';
break;
default:
parent::setSort();
break;
}
}
}
示例3: setSort
protected function setSort()
{
if (!empty($_REQUEST['sort']) && !empty($_REQUEST['dir'])) {
$this->sortDirection = $this->getDb()->escapeStr($_REQUEST['dir']);
$sort = $this->getDb()->escapeStr($_REQUEST['sort']);
switch ($sort) {
case 'date_formated':
$this->sortTable = $this->getTable();
$this->sortField = 'factored_date';
break;
case 'product_title':
$this->sortTable = 'products';
$this->sortField = 'title';
break;
case 'group_title':
$this->sortTable = 'product_groups';
$this->sortField = 'title';
break;
case 'measure_title':
$this->sortTable = 'measures';
$this->sortField = 'title';
break;
case 'factory_title':
$this->sortTable = 'factories';
$this->sortField = 'title';
break;
case 'user':
$this->sortTable = 'users';
$this->sortField = 'fullname';
break;
default:
parent::setSort();
break;
}
}
}