PageRenderTime 74ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 0ms

/controllers/link_categories_controller.php

https://github.com/felixding/LonelyThinker
PHP | 47 lines | 18 code | 3 blank | 26 comment | 4 complexity | 0dd36a6946e0e1a0f673c872629a727f MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. /* SVN FILE: $Id: link_categories_controller.php 28 2009-05-13 12:52:14Z $ */
  3. /**
  4. * Short description for file.
  5. *
  6. * Long description for file
  7. *
  8. * PHP versions 5
  9. *
  10. * Licensed under The BSD License
  11. * Redistributions of files must retain the above copyright notice.
  12. *
  13. * @filesource
  14. * @copyright Copyright 2007-2009, Felix Ding (http://dingyu.me)
  15. * @link http://lonelythinker.org Project LonelyThinker
  16. * @package LonelyThinker
  17. * @author $LastChangedBy: $
  18. * @version $Revision: 28 $
  19. * @modifiedby $LastChangedBy: $
  20. * @lastmodified $Date: 2009-05-13 20:52:14 +0800 (Wed, 13 May 2009) $
  21. * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
  22. */
  23. class LinkCategoriesController extends AppController
  24. {
  25. var $name = 'LinkCategories';
  26. var $scaffold;
  27. var $othAuthRestrictions = array('index', 'add', 'edit', 'delete');
  28. /**
  29. * interface for getting a link category
  30. *
  31. * @date 2009-04-10
  32. */
  33. public function get($linkCategoryId = null)
  34. {
  35. if(($linkCategories = $this->readCache('linkCategories')) === false)
  36. {
  37. if(!isset($linkCategoryId) || empty($linkCategoryId)) $linkCategories = $this->LinkCategory->find('all');
  38. else $linkCategories = $this->LinkCategory->read(null, $linkCategoryId);
  39. $this->writeCache('linkCategories', $linkCategories);
  40. }
  41. return $linkCategories;
  42. }
  43. }
  44. ?>