Changeset 4708
- Timestamp:
- 07/24/08 01:13:07 (4 months ago)
- Location:
- branches
- Files:
-
- 4 modified
-
0.11/lib/Doctrine/Query.php (modified) (1 diff)
-
0.11/lib/Doctrine/Query/JoinCondition.php (modified) (1 diff)
-
1.0/lib/Doctrine/Query.php (modified) (1 diff)
-
1.0/lib/Doctrine/Query/JoinCondition.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/lib/Doctrine/Query.php
r4686 r4708 1545 1545 $assocPath = $prevPath . '.' . $asf->getComponentName(); 1546 1546 1547 $this->_queryComponents[$assocPath] = array('parent' => $prevPath, 'relation' => $relation, 'table' => $asf); 1547 $this->_queryComponents[$assocPath] = array( 1548 'parent' => $prevPath, 1549 'relation' => $relation, 1550 'table' => $asf 1551 ); 1548 1552 1549 1553 $assocAlias = $this->getTableAlias($assocPath, $asf->getTableName()); 1550 1554 1551 $queryPart = $join . $assocTableName . ' ' . $assocAlias; 1552 1553 $queryPart .= ' ON ' . $localAlias 1554 . '.' 1555 . $localTable->getColumnName($localTable->getIdentifier()) // what about composite keys? 1555 $queryPart = $join . $this->_conn->quoteIdentifier($assocTableName) 1556 . ' ' . $this->_conn->quoteIdentifier($assocAlias); 1557 1558 $queryPart .= ' ON ' 1559 . $this->_conn->quoteIdentifier($localAlias . '.' 1560 // what about composite keys? 1561 . $localTable->getColumnName($localTable->getIdentifier())) 1556 1562 . ' = ' 1557 . $ assocAlias . '.' . $relation->getLocal();1563 . $this->_conn->quoteIdentifier($assocAlias . '.' . $relation->getLocal()); 1558 1564 1559 1565 if ($relation->isEqual()) { 1560 1566 // equal nest relation needs additional condition 1561 $queryPart .= ' OR ' . $localAlias1562 . '.'1563 . $table->getColumnName($table->getIdentifier()) 1567 $queryPart .= ' OR ' 1568 . $this->_conn->quoteIdentifier($localAlias . '.' 1569 . $table->getColumnName($table->getIdentifier())) 1564 1570 . ' = ' 1565 . $ assocAlias . '.' . $relation->getForeign();1571 . $this->_conn->quoteIdentifier($assocAlias . '.' . $relation->getForeign()); 1566 1572 } 1567 1573 -
branches/0.11/lib/Doctrine/Query/JoinCondition.php
r4560 r4708 140 140 default: 141 141 $leftExpr = (($hasLeftAggExpression) ? $leftMatches[1] . '(' : '') 142 . $ alias . '.' . $field142 . $conn->quoteIdentifier($alias . '.' . $field) 143 143 . (($hasLeftAggExpression) ? $leftMatches[3] . ')' : '') ; 144 144 -
branches/1.0/lib/Doctrine/Query.php
r4686 r4708 1545 1545 $assocPath = $prevPath . '.' . $asf->getComponentName(); 1546 1546 1547 $this->_queryComponents[$assocPath] = array('parent' => $prevPath, 'relation' => $relation, 'table' => $asf); 1547 $this->_queryComponents[$assocPath] = array( 1548 'parent' => $prevPath, 1549 'relation' => $relation, 1550 'table' => $asf 1551 ); 1548 1552 1549 1553 $assocAlias = $this->getTableAlias($assocPath, $asf->getTableName()); 1550 1554 1551 $queryPart = $join . $assocTableName . ' ' . $assocAlias; 1552 1553 $queryPart .= ' ON ' . $localAlias 1554 . '.' 1555 . $localTable->getColumnName($localTable->getIdentifier()) // what about composite keys? 1555 $queryPart = $join . $this->_conn->quoteIdentifier($assocTableName) 1556 . ' ' . $this->_conn->quoteIdentifier($assocAlias); 1557 1558 $queryPart .= ' ON ' 1559 . $this->_conn->quoteIdentifier($localAlias . '.' 1560 // what about composite keys? 1561 . $localTable->getColumnName($localTable->getIdentifier())) 1556 1562 . ' = ' 1557 . $ assocAlias . '.' . $relation->getLocal();1563 . $this->_conn->quoteIdentifier($assocAlias . '.' . $relation->getLocal()); 1558 1564 1559 1565 if ($relation->isEqual()) { 1560 1566 // equal nest relation needs additional condition 1561 $queryPart .= ' OR ' . $localAlias1562 . '.'1563 . $table->getColumnName($table->getIdentifier()) 1567 $queryPart .= ' OR ' 1568 . $this->_conn->quoteIdentifier($localAlias . '.' 1569 . $table->getColumnName($table->getIdentifier())) 1564 1570 . ' = ' 1565 . $ assocAlias . '.' . $relation->getForeign();1571 . $this->_conn->quoteIdentifier($assocAlias . '.' . $relation->getForeign()); 1566 1572 } 1567 1573 -
branches/1.0/lib/Doctrine/Query/JoinCondition.php
r4560 r4708 140 140 default: 141 141 $leftExpr = (($hasLeftAggExpression) ? $leftMatches[1] . '(' : '') 142 . $ alias . '.' . $field142 . $conn->quoteIdentifier($alias . '.' . $field) 143 143 . (($hasLeftAggExpression) ? $leftMatches[3] . ')' : '') ; 144 144