本文整理汇总了PHP中error::createInvalidOrderbyError方法的典型用法代码示例。如果您正苦于以下问题:PHP error::createInvalidOrderbyError方法的具体用法?PHP error::createInvalidOrderbyError怎么用?PHP error::createInvalidOrderbyError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类error
的用法示例。
在下文中一共展示了error::createInvalidOrderbyError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connectionOrderString
/**
* Create the SQL ORDER and LIMIT BY clause for connections
*
* @param integer $start start row
* @param integer $max max number of rows to return
* @param string $o order by column
* @param string $s sort order (ASC or DESC)
* @return string
*/
function connectionOrderString($o, $s)
{
global $CFG, $HUB_FLM, $HUB_SQL;
//check order by param is valid
switch ($o) {
case "date":
$orderby = "t.CreationDate";
break;
case "moddate":
$orderby = "t.ModificationDate";
break;
case "vote":
$orderby = "vote";
break;
default:
global $ERROR;
$ERROR = new error();
$ERROR->createInvalidOrderbyError();
include $HUB_FLM->getCodeDirPath("core/formaterror.php");
die;
}
//check sort param is valid
switch ($s) {
case "ASC":
$sort = $HUB_SQL->ASC;
break;
case "DESC":
$sort = $HUB_SQL->DESC;
break;
default:
global $ERROR;
$ERROR = new error();
$ERROR->createInvalidSortError();
include $HUB_FLM->getCodeDirPath("core/formaterror.php");
die;
}
if ($o == 'vote') {
$str = $HUB_SQL->ORDER_BY . $orderby . " " . $sort . ", weight " . $HUB_SQL->DESC . ", CreationDate " . $HUB_SQL->DESC;
} else {
$str = $HUB_SQL->ORDER_BY . $orderby . " " . $sort;
}
return $str;
}
示例2: connectionOrderString
/**
* Create the SQL ORDER and LIMIT BY clause for connections
*
* @param integer $start start row
* @param integer $max max number of rows to return
* @param string $o order by column
* @param string $s sort order (ASC or DESC)
* @return string
*/
function connectionOrderString($o, $s)
{
global $CFG, $HUB_FLM, $HUB_SQL;
//check order by param is valid
switch ($o) {
case "date":
$orderby = "t.CreationDate";
break;
case "moddate":
$orderby = "t.ModificationDate";
break;
case "vote":
$orderby = "vote";
break;
case "ideavote":
$orderby = "vote";
break;
case "fromname":
$orderby = "t.FromLabel";
break;
case "toname":
$orderby = "t.ToLabel";
break;
case "random":
//MB: This does not scale and should be replaced eventually.
$day = date('j', time());
$hour = date('G', time());
$orderby = "RAND(" . $day . $hour . ")";
break;
default:
global $ERROR;
$ERROR = new error();
$ERROR->createInvalidOrderbyError();
include $HUB_FLM->getCodeDirPath("core/formaterror.php");
die;
}
//check sort param is valid
switch ($s) {
case "ASC":
$sort = $HUB_SQL->ASC;
break;
case "DESC":
$sort = $HUB_SQL->DESC;
break;
default:
global $ERROR;
$ERROR = new error();
$ERROR->createInvalidSortError();
include $HUB_FLM->getCodeDirPath("core/formaterror.php");
die;
}
if ($o == 'ideavote') {
$str = $HUB_SQL->ORDER_BY . $orderby . " " . $sort . ", weight " . $HUB_SQL->DESC . ", kids " . $HUB_SQL->DESC . ", kidsweight " . $HUB_SQL->DESC;
} else {
if ($o == 'vote') {
$str = $HUB_SQL->ORDER_BY . $orderby . " " . $sort . ", weight " . $HUB_SQL->DESC . ", CreationDate " . $HUB_SQL->DESC;
} else {
$str = $HUB_SQL->ORDER_BY . $orderby . " " . $sort;
}
}
return $str;
}