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

Class: Services_Facebook_Connect

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

Class Overview

Services_Facebook_Common
   |
   --Services_Facebook_Connect

Facebook Application Interface


Author(s):

Version:

  • Release: 0.2.14

Methods


Inherited Variables

Inherited Methods


Class Details

[line 46]
Facebook Application Interface

  1.  <?php
  2.  require_once 'Services/Facebook.php';
  3.  $api = new Services_Facebook();
  4.  $app $api->connect->('');
  5.  ?>



[ Top ]


Method Detail

__construct (Constructor)   [line 57]

void __construct( )

Construct

Various tasks that should be ran before non-static methods

  • Access: public

Overrides Services_Facebook_Common::__construct() (Construct)
[ Top ]

getUnconnectedFriendsCount   [line 78]

int getUnconnectedFriendsCount( )

Unconnected Friends Count

Get the amount of users friends that have not connected their account to your site. NOTE: These are users that you have sent connect.registerUser information.

  • Return: Amount of users
  • Access: public

[ Top ]

hashEmail   [line 201]

string hashEmail( string $email)

hashEmail

Parameters:

string   $email   —  Email to hash

[ Top ]

hashEmails   [line 224]

array hashEmails( array $emails)

hashEmails
  • Return: Hashed emails
  • Access: public

Parameters:

array   $emails   —  Emails to hash

[ Top ]

registerUsers   [line 122]

object SimpleXML registerUsers( array $accounts)

Register Users

The accounts array may hold up to 1,000 accounts. Each account should hold these array keys: (account_id and account_url are optional)

  1.  // Hash the emails
  2.  $hash1 Services_Facebook_Connect::hashEmail('joe@example.com');
  3.  $hash2 Services_Facebook_Connect::hashEmail('jeff@example.com');
  4.  
  5.  $accounts = array();
  6.  
  7.  $accounts[= array(
  8.      'email_hash'  => $hash1,
  9.      'account_id'  => 12345678,
  10.      'account_url' => 'http://example.com/users?id=12345678'
  11.  )
  12.  
  13.  $accounts[= array(
  14.      'email_hash'  => $hash2,
  15.  )
  16.  
  17.  $connect Services_Facebook::factory('Connect');
  18.  $result  $connect->registerUsers($accounts);

  • Return: object from callMethod()
  • Throws: Services_Facebook_Exception If emash_hash is missing or another field was passed in that is not supported.
  • Access: public

Parameters:

array   $accounts   —  Information about accounts

[ Top ]

unregisterUsers   [line 180]

object SimpleXML unregisterUsers( array $emailHashes)

unregisterUsers

This method allows a site to unregister a connected account. You should call this method if the user deletes his account on your site.

  1.  $hashes = array();
  2.  $hashes[Services_Facebook_Connect::hashEmail('joe@example.com');
  3.  $hashes[Services_Facebook_Connect::hashEmail('jeff@example.com');
  4.  
  5.  $connect = new Services_Facebook::factory('Connect');
  6.  $result  $connect->unregisterUsers($hashes);

  • Return: object from callMethod()
  • Throws: Services_Facebook_Exception if json_decode() is not available
  • Access: public

Parameters:

array   $emailHashes   —  An array of email_hashes to unregister

[ Top ]


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