diff --git a/src/ORM/Marshaller.php b/src/ORM/Marshaller.php index bc424ac7d51..9cf2f3fce7f 100644 --- a/src/ORM/Marshaller.php +++ b/src/ORM/Marshaller.php @@ -108,9 +108,10 @@ public function one(array $data, array $options = []) $primaryKey = $schema->primaryKey(); if (array_intersect($primaryKey, array_keys($data)) == $primaryKey) { + $tableName=$this->_table->table(); $record = $this->_table->find('all'); foreach ($primaryKey as $pkey) { - $record->where(["$pkey" => $data[$pkey] ]); + $record->where(["$tableName.$pkey" => $data[$pkey] ]); } $record = $record->first();