Merge branch 'master' of https://git.mcnd.ca/mcndave/ulmus
This commit is contained in:
commit
e4767f7c09
11 files changed
+178
-55
No files matched your search
@@ -53,7 +53,7 @@ trait ConditionTrait
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function notWhere($field, $value, string $operator = Query\Where::OPERATOR_NOT_EQUAL) : self
|
||||
public function notWhere($field, $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
|
||||
{
|
||||
$this->queryBuilder->where($field, $value, $operator, Query\Where::CONDITION_AND, true);
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class RelationBuilder
|
||||
protected function applyFilter(Repository $repository, string $name) : Repository
|
||||
{
|
||||
foreach($this->filters ?? [] as $filter) {
|
||||
$repository = call_user_func_array([ $this->entity, $filter->method ], [ $repository, $name ]);
|
||||
$repository = call_user_func_array([ $this->entity, $filter->method ], [ $repository, $name, false ]);
|
||||
}
|
||||
|
||||
return $repository;
|
||||
@@ -154,7 +154,8 @@ class RelationBuilder
|
||||
$name = strtolower($name);
|
||||
|
||||
foreach($data ?: $this->entity->entityLoadedDataset as $key => $value) {
|
||||
if ( $key === "{$name}\$collection" ) {
|
||||
|
||||
if ( $key === sprintf(static::SUBQUERY_FIELD_SUFFIX, strtolower($name)) ) {
|
||||
if ($value) {
|
||||
if ( null === ( $dataset = \json_decode($value, true) ) ) {
|
||||
throw new \Exception(sprintf("JSON error '%s' from '%s'", \json_last_error_msg(), $value));
|
||||
@@ -166,7 +167,7 @@ class RelationBuilder
|
||||
return $entity::entityCollection();
|
||||
}
|
||||
}
|
||||
elseif ( substr($key, 0, $len ) === "{$name}\$" ) {
|
||||
elseif ( substr($key, 0, $len ) === sprintf(static::JOIN_FIELD_SEPARATOR, strtolower($name)) ) {
|
||||
$vars[substr($key, $len)] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user