Services_Facebook
[ class tree: Services_Facebook ] [ index: Services_Facebook ] [ all elements ]

Class: Services_Facebook_Batch

Source Location: /Services_Facebook-0.2.14/Services/Facebook/Batch.php

Class Overview

Services_Facebook_Common
   |
   --Services_Facebook_Batch

Facebook Batch Interface


Author(s):

Version:

  • Release: 0.2.14

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 46]
Facebook Batch Interface

  1.  $batch = new Services_Facebook_Batch;
  2.  $batch->sessionKey = 'fooo';
  3.  $batch->addCall('restriction''admin.getRestrictionInfo');
  4.  $batch->addCall('friends''friends.get'array('uid' => 683226814));
  5.  $batch->addCall('areFriends''friends.areFriends'array('uid1' => 617370918'uid2' => 683226814));
  6.  $batch->run();
  7.  
  8.  var_dump($batch['friends']);
  9.  ?>



[ Top ]


Class Variables

$calls = array()

[line 56]

Calls
  • Var: Calls that will be batched
  • Access: protected

Type:   array


[ Top ]

$results = array()

[line 63]

Results
  • Var: Name value pair of results
  • Access: protected

Type:   array


[ Top ]



Method Detail

addCall   [line 77]

void addCall( mixed $name, mixed $endpoint, [array $args = array()])

Add call

Adds a call to be batched.


Parameters:

mixed   $name   —  Name of the result
mixed   $endpoint   —  Facebook API endpoint. e.g. friends.get
array   $args   —  Arguments for the API call

[ Top ]

getResults   [line 133]

array getResults( )

Get results
  • Return: Results from the batch
  • Access: public

[ Top ]

offsetExists   [line 145]

bool offsetExists( string $offset)

Offset exists
  • Return: If element exists
  • Access: public

Parameters:

string   $offset   —  Offset to check

[ Top ]

offsetGet   [line 157]

SimpleXMLElement offsetGet( mixed $offset)

Offset get
  • Return: Result
  • Access: public

Parameters:

mixed   $offset   —  Offset to get

[ Top ]

offsetSet   [line 173]

void offsetSet( mixed $offset, mixed $value)

Offset set

We do not allow the batch results to be modified.

  • Throws: Services_Facebook_Exception
  • Access: public

Parameters:

mixed   $offset   —  Offset to set
mixed   $value   —  Value to set

[ Top ]

offsetUnset   [line 186]

void offsetUnset( mixed $offset)

Offset unset
  • Access: public

Parameters:

mixed   $offset   —  Offset to unset

[ Top ]

run   [line 99]

void run( [mixed $serial = false])

Run

Run the calls that were added via Services_Facebook_Batch::addCall() in a batch. If successful the results are stored.


Parameters:

mixed   $serial   —  If true, calls will be ran in order on on Facebook's side.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:36:58 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.