PageRenderTime 56ms CodeModel.GetById 33ms RepoModel.GetById 1ms app.codeStats 0ms

/Settings/Model/Language.php

https://github.com/kareypowell/croogo
PHP | 59 lines | 25 code | 6 blank | 28 comment | 0 complexity | 64a131b8281d5fd1bb3e6d7c3f62743a MD5 | raw file
  1. <?php
  2. App::uses('AppModel', 'Model');
  3. /**
  4. * Language
  5. *
  6. * @category Model
  7. * @package Croogo.Settings.Model
  8. * @version 1.0
  9. * @author Fahad Ibnay Heylaal <contact@fahad19.com>
  10. * @license http://www.opensource.org/licenses/mit-license.php The MIT License
  11. * @link http://www.croogo.org
  12. */
  13. class Language extends AppModel {
  14. /**
  15. * Model name
  16. *
  17. * @var string
  18. * @access public
  19. */
  20. public $name = 'Language';
  21. /**
  22. * Behaviors used by the Model
  23. *
  24. * @var array
  25. * @access public
  26. */
  27. public $actsAs = array(
  28. 'Croogo.Ordered' => array('field' => 'weight', 'foreign_key' => null),
  29. 'Croogo.Trackable',
  30. );
  31. /**
  32. * Validation
  33. *
  34. * @var array
  35. * @access public
  36. */
  37. public $validate = array(
  38. 'title' => array(
  39. 'rule' => array('minLength', 1),
  40. 'message' => 'Title cannot be empty.',
  41. ),
  42. 'alias' => array(
  43. 'isUnique' => array(
  44. 'rule' => 'isUnique',
  45. 'message' => 'This alias has already been taken.',
  46. ),
  47. 'minLength' => array(
  48. 'rule' => array('minLength', 1),
  49. 'message' => 'Alias cannot be empty.',
  50. ),
  51. ),
  52. );
  53. }