Venue.php 720 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. class Venue extends ActiveRecord\Model
  3. {
  4. static $use_custom_get_state_getter = false;
  5. static $use_custom_set_state_setter = false;
  6. static $has_many = array(
  7. 'events',
  8. array('hosts', 'through' => 'events')
  9. );
  10. static $has_one;
  11. static $alias_attribute = array(
  12. 'marquee' => 'name',
  13. 'mycity' => 'city'
  14. );
  15. public function get_state()
  16. {
  17. if (self::$use_custom_get_state_getter)
  18. return strtolower($this->read_attribute('state'));
  19. else
  20. return $this->read_attribute('state');
  21. }
  22. public function set_state($value)
  23. {
  24. if (self::$use_custom_set_state_setter)
  25. return $this->assign_attribute('state', $value . '#');
  26. else
  27. return $this->assign_attribute('state', $value);
  28. }
  29. };
  30. ?>