Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into 3.next-cake5
Browse files Browse the repository at this point in the history
  • Loading branch information
arusinowski committed Apr 24, 2024
2 parents 9169b64 + 2bed5b5 commit 1bb8e46
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Model/Behavior/Strategy/ConstStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ public function beforeFind(EventInterface $event, SelectQuery $query, ArrayObjec
->map(function (EntityInterface $row): EntityInterface {
$constant = Hash::get($row, $this->getConfig('field'));

if ($constant instanceof Entity) {
return $row;
}

$field = Inflector::singularize(Inflector::underscore($this->alias));
$value = new Entity([
'label' => Hash::get($this->getConstants(), $constant, $constant),
Expand Down

0 comments on commit 1bb8e46

Please sign in to comment.