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