当前位置: 首页>>代码示例>>PHP>>正文


PHP Expression::andChain方法代码示例

本文整理汇总了PHP中Expression::andChain方法的典型用法代码示例。如果您正苦于以下问题:PHP Expression::andChain方法的具体用法?PHP Expression::andChain怎么用?PHP Expression::andChain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Expression的用法示例。


在下文中一共展示了Expression::andChain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: makeSqlSelectQuery

 /**
  * @return ISqlSelectQuery
  */
 private function makeSqlSelectQuery(EntityQuery $query)
 {
     $query = $query->toSelectQuery();
     $joinMethod = SqlJoinMethod::INNER;
     $childrenTable = $this->getChildren()->getPhysicalSchema()->getTable();
     $proxyTable = $this->mtm->getProxy()->getPhysicalSchema()->getTable();
     $condition = Expression::andChain();
     $srcSqlFields = $this->getChildren()->getLogicalSchema()->getIdentifier()->getFields();
     $dstSqlFields = $this->mtm->getEncapsulantProxyProperty()->getFields();
     foreach ($srcSqlFields as $k => $v) {
         $condition->add(Expression::eq(new SqlColumn($srcSqlFields[$k], $childrenTable), new SqlColumn($dstSqlFields[$k], $proxyTable)));
     }
     $query->join(new SqlConditionalJoin(new SelectQuerySource(new SqlIdentifier($proxyTable)), new SqlJoinMethod($joinMethod), $condition));
     $columnName = $this->mtm->getContainerProxyProperty()->getField();
     $query->andWhere(Expression::eq(new SqlColumn($columnName, $this->mtm->getProxy()->getPhysicalSchema()->getTable()), new SqlValue($this->getParentObject()->_getId())));
     return $query;
 }
开发者ID:phoebius,项目名称:phoebius,代码行数:20,代码来源:ManyToManyContainer.class.php

示例2: join

 /**
  * @return void
  */
 private function join(OrmProperty $property, AssociationPropertyType $type, EntityQueryBuilder $builder, SelectQuerySource $source)
 {
     $joinMethod = $type->getAssociationMultiplicity()->is(AssociationMultiplicity::EXACTLY_ONE) ? SqlJoinMethod::INNER : SqlJoinMethod::LEFT;
     $condition = Expression::andChain();
     $srcSqlFields = $property->getFields();
     $dstSqlFields = $builder->entity->getLogicalSchema()->getIdentifier()->getFields();
     foreach ($srcSqlFields as $k => $v) {
         $condition->add(Expression::eq(new SqlColumn($srcSqlFields[$k], $this->alias), new SqlColumn($dstSqlFields[$k], $builder->alias)));
     }
     $source->join(new SqlConditionalJoin(new SelectQuerySource(new AliasedSqlValueExpression(new SqlIdentifier($builder->table), $builder->alias)), new SqlJoinMethod($joinMethod), $condition));
 }
开发者ID:phoebius,项目名称:phoebius,代码行数:14,代码来源:EntityQueryBuilder.class.php


注:本文中的Expression::andChain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。