You are here

public function FBAutopostEntity::publishEntity in Facebook Autopost 7

Publishes content stored in a Facebook publication entity

Parameters

FacebookPublicationEntity $publication: The fully loaded Facebook publication entity.

string $page_id: Page id (among those already selected via UI). If this is present it will override the parameter destination. Use 'me' to publish to the user's timeline

Return value

string Facebook id string for the publication. Needed to edit, or delete the publication.

Throws

FBAutopostException

See also

FBAutopost::publish()

1 call to FBAutopostEntity::publishEntity()
FBAutopostEntity::remoteEntityEdit in fb_autopost_entity/class/FBAutopostEntity.php
Edits a publication in facebook from a stored entity.

File

fb_autopost_entity/class/FBAutopostEntity.php, line 29
Handles the Entity publication.

Class

FBAutopostEntity
Handles publishing using a Facebook publication entity.

Code

public function publishEntity(FacebookPublicationEntity $publication, string $page_id = NULL) {

  // Invoke FBAutopost::publish() with the parameters from $publication.
  return parent::publish(array(
    'type' => $publication->type,
    'params' => fb_autopost_entity_get_properties($publication),
    // We need to control serialization to handle class loading
    'entity' => serialize($publication),
  ), $page_id);
}