This repository has been archived by the owner on Dec 28, 2017. It is now read-only.
forked from yourpalmark/facebook-actionscript-api
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added FQL version of the status table objects.
- Loading branch information
Showing
2 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package com.facebook.graph.data.fql.status | ||
{ | ||
import com.facebook.graph.data.api.status.FacebookStatusMessage; | ||
import com.facebook.graph.utils.FacebookDataUtils; | ||
|
||
/** | ||
* VO to hold information about a queried status message. | ||
*/ | ||
public class FQLStatus | ||
{ | ||
/** | ||
* The ID of the owner of the status message being queried. | ||
*/ | ||
public var uid:Number; | ||
|
||
/** | ||
* The ID of the status message being queried. | ||
*/ | ||
public var status_id:Number; | ||
|
||
/** | ||
* The message of the status message being queried. | ||
*/ | ||
public var message:String; | ||
|
||
/** | ||
* The source of the status message being queried. | ||
*/ | ||
public var source:String; | ||
|
||
/** | ||
* The time of the status message being queried. | ||
*/ | ||
public var time:Date; | ||
|
||
/** | ||
* Creates a new FQLStatus. | ||
*/ | ||
public function FQLStatus() | ||
{ | ||
} | ||
|
||
/** | ||
* Populates and returns a new FQLStatus from a decoded JSON object. | ||
* | ||
* @param result A decoded JSON object. | ||
* | ||
* @return A new FQLStatus. | ||
*/ | ||
public static function fromJSON( result:Object ):FQLStatus | ||
{ | ||
var status:FQLStatus = new FQLStatus(); | ||
status.fromJSON( result ); | ||
return status; | ||
} | ||
|
||
/** | ||
* Populates the user from a decoded JSON object. | ||
*/ | ||
public function fromJSON( result:Object ):void | ||
{ | ||
if( result != null ) | ||
{ | ||
for( var property:String in result ) | ||
{ | ||
switch( property ) | ||
{ | ||
case "time": | ||
if( hasOwnProperty( property ) ) this[ property ] = FacebookDataUtils.stringToDate( result[ property ] ); | ||
break; | ||
|
||
default: | ||
if( hasOwnProperty( property ) ) this[ property ] = result[ property ]; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Provides the string value of this instance. | ||
*/ | ||
public function toString():String | ||
{ | ||
return '[ uid: ' + uid + ', message: ' + message + ' ]'; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.facebook.graph.data.fql.status | ||
{ | ||
public class FQLStatusField | ||
{ | ||
public static const UID:String = "uid"; | ||
public static const STATUS_ID:String = "status_id"; | ||
public static const TIME:String = "time"; | ||
public static const SOURCE:String = "source"; | ||
public static const MESSAGE:String = "message"; | ||
} | ||
} |