Skip to content

Commit

Permalink
Fixing Issue with $constant beeing of type /Cake/ORM/Entity
Browse files Browse the repository at this point in the history
  • Loading branch information
kaihoefler committed Mar 24, 2024
1 parent cf3a212 commit a8ff5d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Model/Behavior/Strategy/ConstStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ public function beforeFind(EventInterface $event, Query $query, ArrayObject $opt

$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 a8ff5d4

Please sign in to comment.