Skip to content

Instantly share code, notes, and snippets.

@doctrinebot
Created December 13, 2015 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doctrinebot/59eae5816b95e80c24a9 to your computer and use it in GitHub Desktop.
Save doctrinebot/59eae5816b95e80c24a9 to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DDC-1026 - https://github.com/doctrine/doctrine2/issues/1616
diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php
index 5c7f074..e17e3f4 100644
--- a/lib/Doctrine/ORM/AbstractQuery.php
+++ b/lib/Doctrine/ORM/AbstractQuery.php
@@ -522,7 +522,7 @@ abstract class AbstractQuery
return $result;
} else {
// Cache hit.
- return $cached[$id];
+ return is_array($cached) ? $cached[$id]:$cached;
}
}
diff -ur a/Doctrine/ORM/AbstractQuery.php b/Doctrine/ORM/AbstractQuery.php
--- a/Doctrine/ORM/AbstractQuery.php 1970-01-01 10:13:08.000000000 +0100
+++ b/Doctrine/ORM/AbstractQuery.php 2011-02-24 16:23:58.000000000 +0000
@@ -517,7 +517,7 @@
$stmt, $this->_resultSetMapping, $this->_hints
);
- $cacheDriver->save($id, $result, $this->_resultCacheTTL);
+ $cacheDriver->save($id, array($id => $result), $this->_resultCacheTTL);
return $result;
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment