Skip to content

Commit

Permalink
Fix logic when hydate value object
Browse files Browse the repository at this point in the history
  • Loading branch information
adrorocker committed Feb 21, 2020
1 parent 40b273f commit a595d9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/System/Builders/EntityBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Analogue\ORM\System\InternallyMappable;
use Analogue\ORM\System\Mapper;
use Analogue\ORM\System\Wrappers\Factory;
use Illuminate\Support\Str;

/**
* This class builds an array of Entity object(s) from a result set.
Expand Down Expand Up @@ -186,7 +187,7 @@ protected function hydrateValueObject(&$attributes, $localKey, $valueClass)
$voWrapper = $this->factory->make($valueObject);

foreach ($embeddedAttributes as $key) {
$prefix = lcfirst(class_basename($valueClass)).'_';
$prefix = Str::snake(class_basename($valueClass)).'_';

$voWrapper->setEntityAttribute($key, $attributes[$prefix.$key]);

Expand Down

0 comments on commit a595d9d

Please sign in to comment.