- Added limitation on fixedValue in Where attribute
This commit is contained in:
1 parent
1fac12c928
commit
589524ca3a
5 files changed
+28
-19
No files matched your search
+14
-14
@@ -476,23 +476,23 @@ class Repository implements RepositoryInterface
|
||||
$foreignKey = is_string($attribute->foreignKey) ? $entity::field($attribute->foreignKey, $alias) : $attribute->foreignKey;
|
||||
|
||||
$this->join("LEFT", $entity::resolveEntity()->tableName(), $key, $foreignKey, $alias, function($join) use ($item, $entity, $alias, $options) {
|
||||
if ( ! in_array(WithOptionEnum::SkipJoinWhere, $options)) {
|
||||
foreach($this->entityResolver->searchFieldAnnotationList($item, [ Where::class ]) as $condition) {
|
||||
if ( ! is_object($condition->field) ) {
|
||||
$field = $this->entityClass::field($condition->field);
|
||||
}
|
||||
else {
|
||||
$field = clone $condition->field;
|
||||
}
|
||||
if ( ! in_array(WithOptionEnum::SkipJoinWhere, $options)) {
|
||||
foreach($this->entityResolver->searchFieldAnnotationList($item, [ Where::class ]) as $condition) {
|
||||
if ( ! is_object($condition->field) ) {
|
||||
$field = $this->entityClass::field($condition->field);
|
||||
}
|
||||
else {
|
||||
$field = clone $condition->field;
|
||||
}
|
||||
|
||||
# Adding directly
|
||||
if ( $field->entityClass === $entity ) {
|
||||
$field->alias = $alias;
|
||||
# Adding directly
|
||||
if ( $field->entityClass === $entity ) {
|
||||
$field->alias = $alias;
|
||||
|
||||
$join->where(is_object($field) ? $field : $entity::field($field, $alias), $condition->getValue(), $condition->operator);
|
||||
$join->where(is_object($field) ? $field : $entity::field($field, $alias), $condition->getValue(), $condition->operator);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! in_array(WithOptionEnum::SkipJoinFilter, $options) ) {
|
||||
foreach ($this->entityResolver->searchFieldAnnotationList($item, [ FilterJoin::class ]) as $filter) {
|
||||
@@ -594,7 +594,7 @@ class Repository implements RepositoryInterface
|
||||
|
||||
foreach ($where as $condition) {
|
||||
# $repository->where($condition->field, is_callable($condition->value) ? call_user_func_array($condition->value, [$this]) : $condition->getValue(), $condition->operator, $condition->condition);
|
||||
$repository->where($condition->field, $condition->getValue($this), $condition->operator, $condition->condition);
|
||||
$repository->where($condition->field, $condition->getValue(/* why repository sent here ??? $this */), $condition->operator, $condition->condition);
|
||||
}
|
||||
|
||||
foreach ($order as $item) {
|
||||
|
||||
Reference in new issue
Block a user