当前位置: 首页>>代码示例>>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;未经允许,请勿转载。