/** * Deletes a publication from facebook stored in an entity. * * @param FacebookPublicationEntity $publication * The fully loaded Facebook publication entity. * * @return boolean * TRUE if the publication was deleted successfully. * * @throws FBAutopostException * @see FBAutopost::remoteDelete() */ public function remoteEntityDelete(FacebookPublicationEntity $publication) { // Get a wrapper for the entity and extract the remote ID. $wrapper = entity_metadata_wrapper('facebook_publication', $publication); $remote_id = $wrapper->facebook_id->value(); // If there is a remote ID in return, then delete the associated // publication. if (!empty($remote_id)) { return parent::remoteDelete($remote_id); } else { throw new FBAutopostException(t('Remote ID could not be found.'), FBAutopost::missing_param, WATCHDOG_ERROR); } }