Guest User

model_user

a guest
Jan 20th, 2012
59
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. class Model_User extends \Orm\Model
  3. {
  4.   protected static $_belongs_to = array(
  5.     'department' => array(
  6.    'cascade_save' => true,
  7.    'cascade_delete' => true,
  8.     ));
  9.  
  10.  protected static $_properties = array(
  11.   'id',
  12.   'username' => array(
  13.     'validation' => array('required'),
  14.     ),
  15.   'department_id' => array(
  16.     'validation' => array('required'),
  17.     ),
  18.   'created_at',
  19.   'updated_at'
  20.  );
  21.  
  22.  protected static $_observers = array(
  23.   'Orm\Observer_CreatedAt' => array(
  24.    'events' => array('before_insert'),
  25.    'mysql_timestamp' => false,
  26.   ),
  27.   'Orm\Observer_UpdatedAt' => array(
  28.    'events' => array('before_save'),
  29.    'mysql_timestamp' => false,
  30.   ),
  31.   'Orm\\Observer_Validation' => array('before_save'),
  32.  );
  33. }
RAW Paste Data