cakephp2-php8/lib/Cake/Model
dogmatic69 00abe27ef8 Breaking out the find so that it can be easily overloaded for caching
Before this commit you have to do some hacks to cache model finds easily. When using
custom find methods like `find('foo')` => `_findFoo(...)` it is common for the
method to adjust the query params.

Trying to cache a query using a hash of the query params :

	function find($type, $query) {
		$query = $this->_beforeFind($query);
		$cacheKey = $type . '_' . md5(selialize($query));

		$cache = Cache::read($cachKey, 'my_cache');
		if ($cacheKey !== false) {
			return $cache;
		}

		$results = $this->_afterFind($type, $query);
		Cache::write($cacheKey, $results, 'my_cache');

		return $results;
	}

Before this commit you either have to completely overload find and rewrite it in the AppModel or call
the before to get the modified `$query` and let cake run the before again.
2013-02-09 16:20:46 +00:00
..
Behavior Updated copyright 2013-02-08 21:28:17 +09:00
Datasource Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
Validator Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
AclNode.php Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
Aco.php Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
AcoAction.php Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
Aro.php Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
BehaviorCollection.php Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
CakeSchema.php Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
ConnectionManager.php Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
I18nModel.php Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
Model.php Breaking out the find so that it can be easily overloaded for caching 2013-02-09 16:20:46 +00:00
ModelBehavior.php Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
ModelValidator.php Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
Permission.php Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00