Skip to content

Commit

Permalink
Merge pull request #15 from falcomnl/added_missing_to_array_trait
Browse files Browse the repository at this point in the history
added missing toArray trait
  • Loading branch information
petericebear authored Jul 19, 2023
2 parents 06885f2 + 6a64e76 commit c87eb7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Models/EboekhoudenRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
namespace IntVent\EBoekhouden\Models;

use DateTime;
use IntVent\EBoekhouden\Contracts\Arrayable;
use IntVent\EBoekhouden\Exceptions\EboekhoudenException;
use IntVent\EBoekhouden\Traits\ProtectedFieldsToArrayTrait;

class EboekhoudenRelation
class EboekhoudenRelation implements Arrayable
{
use ProtectedFieldsToArrayTrait;

protected ?int $id = null;
protected string $relation_type = 'B';
protected string $la = '0';
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/ProtectedFieldsToArrayTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public function toArray()
foreach ($return as $key => $value) {
if (is_array($value)) {
$return[$key] = array_map(
fn ($item): array => $item->toArray(),
fn ($item) => method_exists($item, 'toArray') ? $item->toArray() : $item,
$value
);
}
Expand Down

0 comments on commit c87eb7b

Please sign in to comment.