本文整理汇总了PHP中QQ::Func方法的典型用法代码示例。如果您正苦于以下问题:PHP QQ::Func方法的具体用法?PHP QQ::Func怎么用?PHP QQ::Func使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQ
的用法示例。
在下文中一共展示了QQ::Func方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testFunc
public function testFunc()
{
$objTest = new TypeTest();
$objTest->TestFloat = -1.0;
$objTest->Save();
$objTest2 = new TypeTest();
$objTest2->TestFloat = -2.0;
$objTest2->Save();
$objResArray = TypeTest::QueryArray(QQ::GreaterThan(QQ::Func('ABS', QQN::TypeTest()->TestFloat), 1.0));
$this->assertEquals(1, count($objResArray));
if (count($objResArray) > 0) {
$objRes = $objResArray[0];
$this->assertNotNull($objRes);
if ($objRes) {
$this->assertEquals(-2.0, $objRes->TestFloat);
}
}
$objTest->Delete();
$objTest2->Delete();
}
示例2: testVirtualAttributeAliases
public function testVirtualAttributeAliases()
{
$clauses = [QQ::GroupBy(QQN::Project()->ProjectStatusTypeId), QQ::Sum(QQN::Project()->Budget, 'Budget Amount'), QQ::Expand(QQ::Virtual('Balance', QQ::Func('SUM', QQ::Sub(QQN::Project()->Budget, QQN::Project()->Spent))))];
$cond = QQ::Equal(QQN::Project()->ProjectStatusTypeId, ProjectStatusType::Open);
$objProject = Project::QuerySingle($cond, $clauses);
$amount1 = $objProject->GetVirtualAttribute('Budget Amount');
$this->assertEquals(83000, $amount1);
$amount2 = $objProject->GetVirtualAttribute('Balance');
$this->assertEquals(5599.5, $amount2);
}
示例3: __construct
public function __construct(QQColumnNode $objNode, $strAttributeName)
{
$this->objNode = QQ::Func($this->strFunctionName, $objNode);
$this->strAttributeName = QQ::GetVirtualAlias($strAttributeName);
// virtual attributes are queried lower case
}