CacheId.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. namespace app\common\components;
  3. use Yii;
  4. class CacheId
  5. {
  6. static function getInitCls()
  7. {
  8. static $initCls = NULL;
  9. if(!isset($initCls)) $initCls = new CacheId();
  10. return $initCls;
  11. }
  12. //模型字段缓存文件
  13. static function modelFieldCacheId($model_id)
  14. {
  15. return 'modelfield_'.$model_id;
  16. }
  17. //内容模型缓存文件
  18. static function modelListCacheId()
  19. {
  20. return 'modellist';
  21. }
  22. //栏目缓存文件ID
  23. static function categoryCacheId()
  24. {
  25. return 'categorys';
  26. }
  27. //内容模型下的栏目Item缓存
  28. static function categoryItemsCacheId($model_id)
  29. {
  30. return 'category_items_'.$model_id;
  31. }
  32. //来源
  33. static function copyFromCacheId()
  34. {
  35. return 'copyfrom';
  36. }
  37. //用户组
  38. static function groupCacheId()
  39. {
  40. return 'grouplist';
  41. }
  42. //联动菜单数据缓存
  43. static function linkMenuCacheId($id)
  44. {
  45. return 'linkmenu_'.$id;
  46. }
  47. //导航
  48. static function navCacheId()
  49. {
  50. return 'nav';
  51. }
  52. //推荐位
  53. static function positionCacheId()
  54. {
  55. return 'position';
  56. }
  57. static function typeCacheId()
  58. {
  59. return 'typelist';
  60. }
  61. //系统配置
  62. static function siteConfigCacheId()
  63. {
  64. return 'siteconfig';
  65. }
  66. }