本文整理汇总了PHP中QQ::Between方法的典型用法代码示例。如果您正苦于以下问题:PHP QQ::Between方法的具体用法?PHP QQ::Between怎么用?PHP QQ::Between使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQ
的用法示例。
在下文中一共展示了QQ::Between方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDbTypeCasting
public function testDbTypeCasting()
{
$dt1 = new QDateTime('Jan 15 2006');
$dt2 = new QDateTime('Mar 15 2006');
$cond = QQ::Between(QQN::Project()->StartDate, $dt1, $dt2);
$a = Project::QueryArray($cond);
$this->assertEquals(2, count($a), "Between 2 QDateTime types works");
$cond = QQ::Between(QQN::Project()->Budget, 2000, 3000);
$a = Project::QueryArray($cond);
$this->assertEquals(1, count($a), "Between 2 int types works");
$cond = QQ::Between(QQN::Project()->Name, 'A', 'C');
$a = Project::QueryArray($cond);
$this->assertEquals(3, count($a), "Between 2 string types works");
}
示例2: _
public static function _(QQNode $objQueryNode, $strSymbol, $mixValue, $mixValueTwo = null)
{
try {
switch (strtolower(trim($strSymbol))) {
case '=':
return QQ::Equal($objQueryNode, $mixValue);
case '!=':
return QQ::NotEqual($objQueryNode, $mixValue);
case '>':
return QQ::GreaterThan($objQueryNode, $mixValue);
case '<':
return QQ::LessThan($objQueryNode, $mixValue);
case '>=':
return QQ::GreaterOrEqual($objQueryNode, $mixValue);
case '<=':
return QQ::LessOrEqual($objQueryNode, $mixValue);
case 'in':
return QQ::In($objQueryNode, $mixValue);
case 'not in':
return QQ::NotIn($objQueryNode, $mixValue);
case 'like':
return QQ::Like($objQueryNode, $mixValue);
case 'not like':
return QQ::NotLike($objQueryNode, $mixValue);
case 'is null':
return QQ::IsNull($objQueryNode, $mixValue);
case 'is not null':
return QQ::IsNotNull($objQueryNode, $mixValue);
case 'between':
return QQ::Between($objQueryNode, $mixValue, $mixValueTwo);
case 'not between':
return QQ::NotBetween($objQueryNode, $mixValue, $mixValueTwo);
default:
throw new QCallerException('Unknown Query Comparison Operation: ' . $strSymbol, 0);
}
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}