當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataQuery::innerJoin方法代碼示例

本文整理匯總了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());
 }
開發者ID:normann,項目名稱:sapphire,代碼行數:12,代碼來源:DataQueryTest.php

示例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;
 }
開發者ID:helpfulrobot,項目名稱:sunnysideup-ecommerce,代碼行數:13,代碼來源:OrderFilters.php

示例3: testRelationOrderWithCustomJoin

 public function testRelationOrderWithCustomJoin()
 {
     $dataQuery = new DataQuery('DataQueryTest_B');
     $dataQuery->innerJoin('DataQueryTest_D', '"DataQueryTest_D"."RelationID" = "DataQueryTest_B"."ID"');
     $dataQuery->execute();
 }
開發者ID:ivoba,項目名稱:silverstripe-framework,代碼行數:6,代碼來源:DataQueryTest.php

示例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;
 }
開發者ID:nomidi,項目名稱:sapphire,代碼行數:13,代碼來源:DataList.php

示例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;
 }
開發者ID:helpfulrobot,項目名稱:swipestripe-swipestripe-category,代碼行數:17,代碼來源:ProductCategory.php


注:本文中的DataQuery::innerJoin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。