本文整理匯總了PHP中DataQuery::leftJoin方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataQuery::leftJoin方法的具體用法?PHP DataQuery::leftJoin怎麽用?PHP DataQuery::leftJoin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DataQuery
的用法示例。
在下文中一共展示了DataQuery::leftJoin方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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->assertSQLContains("INNER JOIN \"Group_Members\" ON \"Group_Members\".\"MemberID\" = \"Member\".\"ID\"", $dq->sql($parameters));
$dq = new DataQuery('Member');
$dq->leftJoin("Group_Members", "\"Group_Members\".\"MemberID\" = \"Member\".\"ID\"");
$this->assertSQLContains("LEFT JOIN \"Group_Members\" ON \"Group_Members\".\"MemberID\" = \"Member\".\"ID\"", $dq->sql($parameters));
}
示例2: leftJoin
/**
* Add an left 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 leftJoin($table, $onClause, $alias = null)
{
$this->dataQuery->leftJoin($table, $onClause, $alias);
return $this;
}