Skip to content
This repository has been archived by the owner on Dec 28, 2017. It is now read-only.

Commit

Permalink
Added FQL version of the status table objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
psyked committed Jun 20, 2011
1 parent eecb602 commit 87857f4
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
89 changes: 89 additions & 0 deletions src/com/facebook/graph/data/fql/status/FQLStatus.as
@@ -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 + ' ]';
}

}
}
11 changes: 11 additions & 0 deletions src/com/facebook/graph/data/fql/status/FQLStatusField.as
@@ -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";
}
}

0 comments on commit 87857f4

Please sign in to comment.