/**
  * Edits a publication in facebook from a stored entity. Events in Facebook
  * can actually be updated, this means that there is no deletion needed.
  *
  * @param FacebookPublicationEntity $publication
  *   The fully loaded Facebook publication entity
  *
  * @throws FBAutopostException
  * @see FBAutopost::remoteEdit()
  */
 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']);
 }
 /**
  * Publishes content stored in a Facebook publication entity
  *
  * @param FacebookPublicationEntity $publication
  *   The fully loaded Facebook publication entity.
  * @param 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 string
  *   Facebook id string for the publication. Needed to edit, or delete the
  *   publication.
  *
  * @throws FBAutopostException
  * @see FBAutopost::publish()
  */
 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), 'entity' => serialize($publication)), $page_id);
 }