Skip to content

Commit

Permalink
Merge pull request #2 from brunobmorais/AthusFelipe-patch-1
Browse files Browse the repository at this point in the history
Sugestao tratamento valores nulos
  • Loading branch information
brunobmorais authored Mar 5, 2024
2 parents 9841786 + 5910b49 commit 6cf14e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ModelAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ public function toMap($objArray = null): ?array
if (is_array($data) || is_object($data)) {
$result = [];
foreach ($data as $key => $value) {
$result[$key] = (is_array($value) || is_object($value)) ? $this->toMap($value) : $value;
if(strlen($value) > 0)
$result[$key] = (is_array($value) || is_object($value)) ? $this->toMap($value) : $value;
}

return $result;
Expand Down

0 comments on commit 6cf14e0

Please sign in to comment.