RmBldg.php 962 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. class RmBldg extends ActiveRecord\Model
  3. {
  4. static $table = 'rm-bldg';
  5. static $validates_presence_of = array(
  6. array('space_out', 'message' => 'is missing!@#'),
  7. array('rm_name')
  8. );
  9. static $validates_length_of = array(
  10. array('space_out', 'within' => array(1, 5)),
  11. array('space_out', 'minimum' => 9, 'too_short' => 'var is too short!! it should be at least %d long')
  12. );
  13. static $validates_inclusion_of = array(
  14. array('space_out', 'in' => array('jpg', 'gif', 'png'), 'message' => 'extension %s is not included in the list'),
  15. );
  16. static $validates_exclusion_of = array(
  17. array('space_out', 'in' => array('jpeg'))
  18. );
  19. static $validates_format_of = array(
  20. array('space_out', 'with' => '/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i' )
  21. );
  22. static $validates_numericality_of = array(
  23. array('space_out', 'less_than' => 9, 'greater_than' => '5'),
  24. array('rm_id', 'less_than' => 10, 'odd' => null)
  25. );
  26. }
  27. ?>