You are here

public function FBAutopostEntityEvent::remoteEntityEdit in Facebook Autopost 7

Edits a publication in facebook from a stored entity. Events in Facebook can actually be updated, this means that there is no deletion needed.

Parameters

FacebookPublicationEntity $publication: The fully loaded Facebook publication entity

Throws

FBAutopostException

Overrides FBAutopostEntity::remoteEntityEdit

See also

FBAutopost::remoteEdit()

File

fb_autopost_entity/class/FBAutopostEntityEvent.php, line 38
Class implementation for FBAutopostEntityEvent

Class

FBAutopostEntityEvent
Special case for FacebookPublicationType Event

Code

public function remoteEntityEdit(FacebookPublicationEntity $publication_entity) {

  // For an event we should update the Entity, instead of deleting an
  // recreating it.
  $wrapper = entity_metadata_wrapper('facebook_publication', $publication_entity);
  $remote_id = $wrapper->facebook_id
    ->value();
  $publication = array(
    'type' => $publication_entity->type,
    'params' => fb_autopost_entity_get_properties($publication_entity),
  );
  $this
    ->publishParameterPrepare($publication);

  // Call api method from ancestor.
  return $this
    ->api('/' . $remote_id, 'POST', $publication['params']);
}