diff --git a/src/Model/Behavior/Strategy/ConstStrategy.php b/src/Model/Behavior/Strategy/ConstStrategy.php index 785dfe7..324caff 100644 --- a/src/Model/Behavior/Strategy/ConstStrategy.php +++ b/src/Model/Behavior/Strategy/ConstStrategy.php @@ -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),