- Fixed the JOIN comparison (instead of putting it in the main query)

This commit is contained in:
Dave Mc Nicoll 2022-11-24 19:22:49 +00:00
parent b20e537038
commit 902167c2ed
1 changed files with 4 additions and 5 deletions

View File

@ -611,6 +611,7 @@ class Repository
$foreignKey = is_string($annotation->foreignKey) ? $entity::field($annotation->foreignKey, $alias) : $annotation->foreignKey;
$this->join("LEFT", $entity::resolveEntity()->tableName(), $key, $foreignKey, $alias, function($join) use ($item, $entity, $alias) {
foreach($this->entityResolver->searchFieldAnnotationList($item, new Where() ) as $condition) {
if ( ! is_object($condition->field) ) {
$field = $this->entityClass::field($condition->field);
@ -619,14 +620,12 @@ class Repository
$field = clone $condition->field;
}
/* @TODO FIX THIS !
*
* if ( $condition->field->entityClass === $entity ) {
if ( $this->entityClass === $entity ) {
# Adding directly
if ( $field->entityClass === $entity ) {
$field->alias = $alias;
$join->where(is_object($field) ? $field : $entity::field($field, $alias), $condition->value, $condition->operator);
}*/
}
}
foreach($this->entityResolver->searchFieldAnnotationList($item, new FilterJoin() ) as $filter) {