Skip to content

Commit bc2edce

Browse files
authored
Only throw for non-identical, duplicate aliases
1 parent 0ed12da commit bc2edce

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

runtime/lib/query/Criteria.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,9 @@ public function mergeWith(Criteria $criteria, $operator = null)
16611661
}
16621662

16631663
// merge alias
1664-
$commonAliases = array_intersect_key($this->getAliases(), $criteria->getAliases());
1664+
$commonAliases = array_filter( array_intersect_key( $this->getAliases(), $criteria->getAliases() ), function( $key ) use( $criteria ) {
1665+
return $this->getAliases()[$key] != $criteria->getAliases()[$key];
1666+
}, ARRAY_FILTER_USE_KEY );
16651667
if (!empty($commonAliases)) {
16661668
throw new PropelException('The given criteria contains an alias already existing in the current object');
16671669
}

0 commit comments

Comments
 (0)