package app.vo { import mx.utils.ObjectUtil; import mx.collections.ArrayCollection; [Bindable] public class User extends Entity { public var username:String; public var passhash:String; public var firstName:String; public var lastName:String; public var email:String; public var accountType:String; public var originalPasshash:String; public var groups:ArrayCollection; public var bikeCount:int; public var rideCount:int; public var totalTimeElapsed:int; public var totalMileage:Number; public var averageSpeed:Number; public function User(state:*=null) { super(state); } public override function initialize(state:*):void { super.initialize(state); if (state != null) { this.username = state.username; this.passhash = state.passhash; this.firstName = state.firstName; this.lastName = state.lastName; this.email = state.email; this.accountType = state.accountType; if (state.hasOwnProperty("bikeCount")) { this.bikeCount = state.bikeCount; } if (state.hasOwnProperty("rideCount")) { this.rideCount = state.rideCount; } if (state.hasOwnProperty("totalMileage")) { this.totalMileage = state.totalMileage; } if (state.hasOwnProperty("averageSpeed")) { this.averageSpeed = state.averageSpeed; } if (state.hasOwnProperty("totalTimeElapsed")) { this.totalTimeElapsed = state.totalTimeElapsed; } if (state.hasOwnProperty("passhash")) { this.originalPasshash = state.passhash; } } } public function toString():String { return username + " (" + id + ")"; } } }