mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Update documentation for Model::_readDataSource()
Update sample code to generate unique keys based on association conditions as well. Because association conditions are not part of the 'query' they need to be handled separately. Refs #8346
This commit is contained in:
parent
31b3f39b67
commit
1709f54e38
1 changed files with 8 additions and 8 deletions
|
@ -3011,7 +3011,7 @@ class Model extends Object implements CakeEventListener {
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* protected function _readDataSource($type, $query) {
|
* protected function _readDataSource($type, $query) {
|
||||||
* $cacheName = md5(json_encode($query));
|
* $cacheName = md5(json_encode($query) . json_encode($this->hasOne) . json_encode($this->belongsTo));
|
||||||
* $cache = Cache::read($cacheName, 'cache-config-name');
|
* $cache = Cache::read($cacheName, 'cache-config-name');
|
||||||
* if ($cache !== false) {
|
* if ($cache !== false) {
|
||||||
* return $cache;
|
* return $cache;
|
||||||
|
|
Loading…
Reference in a new issue