class Model_User extends Orm\Model { /** * Table name * * @var string */ protected static $_table_name = 'users'; /** * Primary key * * @var array */ protected static $_primary_key = array('id'); /** * Properties * * @var array */ protected static $_properties = array( 'id' => array('data_type' => 'int'), 'username' => array('data_type' => 'varchar', 'validation' => array('required', 'valid_email', 'min_length' => array(3)), 'label' => 'label.username_or_email'), 'password' => array('data_type' => 'varchar', 'validation' => array('min_length' => array(3), 'match_field' => array('password2')), 'label' => 'label.new_password'), 'password2' => array('data_type' => 'varchar', 'label' => 'label.repeat_new_password'), 'group' => array('data_type' => 'int'), 'email' => array('data_type' => 'varchar', 'label' => 'email'), 'firstname' => array('data_type' => 'varchar', 'validation' => array('required'), 'label' => 'label.firstname'), 'lastname' => array('data_type' => 'varchar', 'validation' => array('required'), 'label' => 'label.lastname'), 'last_login' => array('data_type' => 'int', 'default' => 0), 'login_hash' => array('data_type' => 'varchar', 'default' => ''), 'profile_fields' => array('data_type' => 'serialize', 'default' => ''), 'reset_hash' => array('data_type' => 'varchar', 'default' => ''), 'created_at' => array('data_type' => 'time_unix'), 'updated_at' => array('data_type' => 'time_unix'), ); /** * Used observers * * @var array */ protected static $_observers = array( 'Orm\\Observer_Validation' => array( 'events' => array('before_save'), ), 'Orm\\Observer_Typing' => array( 'events' => array('before_save', 'after_save', 'after_load'), ), 'Orm\\Observer_CreatedAt' => array( 'events' => array('before_insert') ), 'Orm\\Observer_UpdatedAt' => array( 'events' => array('before_save') ), 'Observer_Password' => array( 'events' => array('before_save'), 'fields' => 'password' ), ); }
It looks like you're new here. If you want to get involved, click one of these buttons!