diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-20 22:02:33 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-20 22:02:33 +0100 |
commit | 90b5141367db5fcac9ba72042278556612b5dc3f (patch) | |
tree | 369112fd85eab39d36f4726f4f763828e6c560a4 /framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php | |
parent | f6c4b70070a8e4378a37f750d53920e44bcc5857 (diff) |
One class per file: framework/Data
Diffstat (limited to 'framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php')
-rw-r--r-- | framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php | 58 |
1 files changed, 1 insertions, 57 deletions
diff --git a/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php b/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php index 271db675..0021cad8 100644 --- a/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php +++ b/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php @@ -183,60 +183,4 @@ class TSqlMapCacheModel extends TComponent else return 0; } -} - -/** - * TSqlMapCacheTypes enumerable class. - * - * Implemented cache are 'Basic', 'FIFO' and 'LRU'. - * - * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @package System.Data.SqlMap.Configuration - * @since 3.1 - */ -class TSqlMapCacheTypes extends TEnumerable -{ - const Basic='Basic'; - const FIFO='FIFO'; - const LRU='LRU'; -} - -/** - * TSqlMapCacheKey class. - * - * Provides a hash of the object to be cached. - * - * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @package System.Data.SqlMap.Configuration - * @since 3.1 - */ -class TSqlMapCacheKey -{ - private $_key; - - /** - * @param mixed object to be cached. - */ - public function __construct($object) - { - $this->_key = $this->generateKey(serialize($object)); - } - - /** - * @param string serialized object - * @return string crc32 hash of the serialized object. - */ - protected function generateKey($string) - { - return sprintf('%x',crc32($string)); - } - - /** - * @return string object hash. - */ - public function getHash() - { - return $this->_key; - } -} - +}
\ No newline at end of file |