You are here

function facebook_autopost_entity in Facebook Autopost 7

Factory method.

Parameters

string $type: Facebook publication type.

4 calls to facebook_autopost_entity()
rules_action_delete_from_facebook in fb_autopost_entity/fb_autopost_entity.rules.inc
Deletes a publication from Facebook.
rules_action_edit_in_facebook in fb_autopost_entity/fb_autopost_entity.rules.inc
Edits a publication in Facebook.
rules_action_publish_to_facebook in fb_autopost_entity/fb_autopost_entity.rules.inc
Callback function called when executing the action.
rules_action_publish_to_facebook_timeline in fb_autopost_entity/fb_autopost_entity.rules.inc
Callback function called when executing the action.

File

fb_autopost_entity/fb_autopost_entity.module, line 635
Module implementation file

Code

function facebook_autopost_entity($type) {
  switch ($type) {
    case 'photo':
      $fb = new FBAutopostEntityPhoto();
      break;
    case 'event':
      $fb = new FBAutopostEntityEvent();
      break;
    case 'post':
      $fb = new FBAutopostEntityPost();
      break;
    default:
      $fb = new FBAutopostEntity();
      break;
  }
  if ($type) {
    $fb
      ->setType($type);
  }

  // Allow other modules to alter $fb. Useful for altering the underlying
  // BaseFacebook object for things like adding proxy support to curl options
  drupal_alter('facebook_autopost_entiy_fb', $fb);
  return $fb;
}