Skip to content

Commit

Permalink
Merge b2f5e0f into 2a3fecb
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Apr 9, 2020
2 parents 2a3fecb + b2f5e0f commit 43bdb5b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
18 changes: 13 additions & 5 deletions src/Filter/AbstractDateFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,37 @@ public function filter(ProxyQueryInterface $queryBuilder, $alias, $field, $data)

switch ($data['type']) {
case DateType::TYPE_EQUAL:
return $this->applyTypeIsEqual($queryBuilder, $field, $data);
$this->applyTypeIsEqual($queryBuilder, $field, $data);

return;

case DateType::TYPE_GREATER_THAN:
if (!\array_key_exists('value', $data) || !$data['value']) {
return;
}

return $this->applyTypeIsGreaterThan($queryBuilder, $field, $data);
$this->applyTypeIsGreaterThan($queryBuilder, $field, $data);

return;

case DateType::TYPE_LESS_EQUAL:
if (!\array_key_exists('value', $data) || !$data['value']) {
return;
}

return $this->applyTypeIsLessEqual($queryBuilder, $field, $data);
$this->applyTypeIsLessEqual($queryBuilder, $field, $data);

return;

case DateType::TYPE_NULL:
case DateType::TYPE_NOT_NULL:
return $this->applyType($queryBuilder, $this->getOperator($data['type']), $field, null);
$this->applyType($queryBuilder, $this->getOperator($data['type']), $field, null);

return;

case DateType::TYPE_GREATER_EQUAL:
case DateType::TYPE_LESS_THAN:
return $this->applyType($queryBuilder, $this->getOperator($data['type']), $field, $data['value']);
$this->applyType($queryBuilder, $this->getOperator($data['type']), $field, $data['value']);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Guesser/AbstractTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function getParentMetadataForProperty($baseClass, $propertyFullName, M
return $modelManager->getParentMetadataForProperty($baseClass, $propertyFullName);
} catch (MappingException $e) {
// no metadata not found.
return;
return null;
}
}
}
4 changes: 2 additions & 2 deletions src/Model/ModelManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function delete($object)
public function find($class, $id)
{
if (!isset($id)) {
return;
return null;
}

$documentManager = $this->getDocumentManager($class);
Expand Down Expand Up @@ -281,7 +281,7 @@ public function getNormalizedIdentifier($document)

// the document is not managed
if (!$document || !$this->getDocumentManager($document)->getUnitOfWork()->isInIdentityMap($document)) {
return;
return null;
}

$values = $this->getIdentifierValues($document);
Expand Down

0 comments on commit 43bdb5b

Please sign in to comment.