Skip to content

Commit d41bfb6

Browse files
committed
Added mixed field support
1 parent bdd8052 commit d41bfb6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Hydrators/Hydrator.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ protected function mapEntity(string $entityClassName): array
395395
$isArray = false;
396396
$isBool = false;
397397
$isClass = false;
398+
$isMixed = false;
398399

399400
$isNullable = false;
400401

@@ -444,6 +445,11 @@ protected function mapEntity(string $entityClassName): array
444445

445446
} elseif (strtolower($varDatatype) === 'null') {
446447
$isNullable = true;
448+
449+
} elseif (strtolower($varDatatype) === 'mixed') {
450+
$isMixed = true;
451+
452+
$typesFound++;
447453
}
448454
}
449455

@@ -547,6 +553,15 @@ protected function mapEntity(string $entityClassName): array
547553
$isRequired,
548554
$isWritable
549555
);
556+
557+
} elseif ($isMixed) {
558+
$fields[] = new Hydrators\Fields\MixedField(
559+
$isNullable,
560+
$mappedKey,
561+
$fieldName,
562+
$isRequired,
563+
$isWritable
564+
);
550565
}
551566
}
552567
}

0 commit comments

Comments
 (0)