Role.php 693 B

12345678910111213141516171819202122232425262728293031
  1. <?php defined('SYSPATH') OR die('No direct access allowed.');
  2. /**
  3. * Default auth role
  4. *
  5. * @package Kohana/Auth
  6. * @author Kohana Team
  7. * @copyright (c) 2007-2009 Kohana Team
  8. * @license http://kohanaphp.com/license.html
  9. */
  10. class Model_Auth_Role extends ORM {
  11. // Relationships
  12. protected $_has_many = array(
  13. 'users' => array('model' => 'User','through' => 'roles_users'),
  14. );
  15. public function rules()
  16. {
  17. return array(
  18. 'name' => array(
  19. array('not_empty'),
  20. array('min_length', array(':value', 4)),
  21. array('max_length', array(':value', 32)),
  22. ),
  23. 'description' => array(
  24. array('max_length', array(':value', 255)),
  25. )
  26. );
  27. }
  28. } // End Auth Role Model