TestPluginPost.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * Test Plugin Post Model
  4. *
  5. *
  6. *
  7. * PHP 5
  8. *
  9. * CakePHP : Rapid Development Framework (http://cakephp.org)
  10. * Copyright 2005-2011, Cake Software Foundation, Inc.
  11. *
  12. * Licensed under The MIT License
  13. * Redistributions of files must retain the above copyright notice.
  14. *
  15. * @copyright Copyright 2005-2011, Cake Software Foundation, Inc.
  16. * @link http://cakephp.org CakePHP Project
  17. * @package cake.tests.test_app.plugins.test_plugin
  18. * @since CakePHP v 1.2.0.4487
  19. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  20. */
  21. class TestPluginPost extends TestPluginAppModel {
  22. /**
  23. * Name property
  24. *
  25. * @var string
  26. */
  27. public $name = 'Post';
  28. /**
  29. * useTable property
  30. *
  31. * @var string
  32. */
  33. public $useTable = 'posts';
  34. /**
  35. * Validation rules
  36. *
  37. * @var array
  38. */
  39. public $validate = array(
  40. 'title' => array(
  41. 'rule' => array('custom', '.*'),
  42. 'allowEmpty' => true,
  43. 'required' => false,
  44. 'message' => 'Post title is required'
  45. ),
  46. 'body' => array(
  47. 'first_rule' => array(
  48. 'rule' => array('custom', '.*'),
  49. 'allowEmpty' => true,
  50. 'required' => false,
  51. 'message' => 'Post body is required'
  52. ),
  53. 'second_rule' => array(
  54. 'rule' => array('custom', '.*'),
  55. 'allowEmpty' => true,
  56. 'required' => false,
  57. 'message' => 'Post body is super required'
  58. )
  59. ),
  60. );
  61. /**
  62. * Translation domain to use for validation messages
  63. *
  64. * @var string
  65. */
  66. public $validationDomain = 'test_plugin';
  67. }