diff --git a/src/Model/Behavior/Strategy/ConstStrategy.php b/src/Model/Behavior/Strategy/ConstStrategy.php index 6bd80fe..638282b 100644 --- a/src/Model/Behavior/Strategy/ConstStrategy.php +++ b/src/Model/Behavior/Strategy/ConstStrategy.php @@ -132,6 +132,10 @@ 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),