예제 #1
0
 public function setRelationMap(RelationMap $relationMap, $leftTableAlias = null, $relationAlias = null)
 {
     $leftCols = $relationMap->getLeftColumns();
     $rightCols = $relationMap->getRightColumns();
     $nbColumns = $relationMap->countColumnMappings();
     for ($i = 0; $i < $nbColumns; $i++) {
         $this->addExplicitCondition($leftCols[$i]->getTableName(), $leftCols[$i]->getName(), $leftTableAlias, $rightCols[$i]->getTableName(), $rightCols[$i]->getName(), $relationAlias, Criteria::EQUAL);
     }
     $this->relationMap = $relationMap;
     return $this;
 }
 public function setRelationMap(RelationMap $relationMap, $leftTableAlias = null, $relationAlias = null)
 {
     $leftCols = $relationMap->getLeftColumns();
     $rightCols = $relationMap->getRightColumns();
     $nbColumns = $relationMap->countColumnMappings();
     for ($i = 0; $i < $nbColumns; $i++) {
         $leftColName = ($leftTableAlias ? $leftTableAlias : $leftCols[$i]->getTableName()) . '.' . $leftCols[$i]->getName();
         $rightColName = ($relationAlias ? $relationAlias : $rightCols[$i]->getTableName()) . '.' . $rightCols[$i]->getName();
         $this->addCondition($leftColName, $rightColName, Criteria::EQUAL);
     }
     $this->relationMap = $relationMap;
     $this->leftTableAlias = $leftTableAlias;
     $this->relationAlias = $relationAlias;
     return $this;
 }