Role.php 563 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Default auth role
  4. *
  5. * @package Kohana/Auth
  6. * @author Kohana Team
  7. * @copyright (c) Kohana Team
  8. * @license https://koseven.ga/LICENSE.md
  9. */
  10. class Model_Auth_Role extends ORM {
  11. // Relationships
  12. protected $_has_many = [
  13. 'users' => ['model' => 'User','through' => 'roles_users'],
  14. ];
  15. public function rules()
  16. {
  17. return [
  18. 'name' => [
  19. ['not_empty'],
  20. ['min_length', [':value', 4]],
  21. ['max_length', [':value', 32]],
  22. ],
  23. 'description' => [
  24. ['max_length', [':value', 255]],
  25. ]
  26. ];
  27. }
  28. } // End Auth Role Model