diff --git a/src/UnitOfWork.php b/src/UnitOfWork.php index 914a8b33af..9d86c34dbd 100644 --- a/src/UnitOfWork.php +++ b/src/UnitOfWork.php @@ -2394,7 +2394,7 @@ public function createEntity(string $className, array $data, array &$hints = []) $oid = spl_object_id($entity); $this->registerManaged($entity, $id, $data); - if (isset($hints[Query::HINT_READ_ONLY]) && true === $hints[Query::HINT_READ_ONLY]) { + if (isset($hints[Query::HINT_READ_ONLY]) && $hints[Query::HINT_READ_ONLY] === true) { $this->readOnlyObjects[$oid] = true; } }