本文整理汇总了PHP中DataQuery::innerJoin方法的典型用法代码示例。如果您正苦于以下问题:PHP DataQuery::innerJoin方法的具体用法?PHP DataQuery::innerJoin怎么用?PHP DataQuery::innerJoin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataQuery
的用法示例。
在下文中一共展示了DataQuery::innerJoin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testJoins
/**
* Test the leftJoin() and innerJoin method of the DataQuery object
*/
public function testJoins()
{
$dq = new DataQuery('Member');
$dq->innerJoin("Group_Members", "\"Group_Members\".\"MemberID\" = \"Member\".\"ID\"");
$this->assertContains("INNER JOIN \"Group_Members\" ON \"Group_Members\".\"MemberID\" = \"Member\".\"ID\"", $dq->sql());
$dq = new DataQuery('Member');
$dq->leftJoin("Group_Members", "\"Group_Members\".\"MemberID\" = \"Member\".\"ID\"");
$this->assertContains("LEFT JOIN \"Group_Members\" ON \"Group_Members\".\"MemberID\" = \"Member\".\"ID\"", $dq->sql());
}
示例2: apply
/**
*
*@return SQLQuery
**/
public function apply(DataQuery $query)
{
$this->model = $query->applyRelation($this->relation);
$value = $this->getValue();
if ($value && in_array($value, array(0, 1))) {
$query->innerJoin($table = "Payment", $onPredicate = "\"Payment\".\"OrderID\" = \"Order\".\"ID\"", $tableAlias = null);
}
return $query;
}
示例3: testRelationOrderWithCustomJoin
public function testRelationOrderWithCustomJoin()
{
$dataQuery = new DataQuery('DataQueryTest_B');
$dataQuery->innerJoin('DataQueryTest_D', '"DataQueryTest_D"."RelationID" = "DataQueryTest_B"."ID"');
$dataQuery->execute();
}
示例4: innerJoin
/**
* Add an inner join clause to this data list's query.
*
* @param string $table Table name (unquoted)
* @param string $onClause Escaped SQL statement, e.g. '"Table1"."ID" = "Table2"."ID"'
* @param string $alias - if you want this table to be aliased under another name
* @return DataList
*/
public function innerJoin($table, $onClause, $alias = null)
{
$this->dataQuery->innerJoin($table, $onClause, $alias);
return $this;
}
示例5: apply
/**
* Apply filter query SQL to a search query
*
* @see SearchFilter::apply()
* @return SQLQuery
*/
public function apply(DataQuery $query)
{
$this->model = $query->applyRelation($this->relation);
$value = $this->getValue();
if ($value) {
$query->innerJoin('ProductCategory_Products', "\"ProductCategory_Products\".\"ProductID\" = \"SiteTree\".\"ID\"");
$query->innerJoin('SiteTree_Live', "\"SiteTree_Live\".\"ID\" = \"ProductCategory_Products\".\"ProductCategoryID\"");
$query->where("\"SiteTree_Live\".\"ID\" LIKE '%" . Convert::raw2sql($value) . "%'");
}
return $query;
}