You are here

protected function FBAutopostEntityEvent::publishParameterPrepare in Facebook Autopost 7

Prepares the parameters to publish to Facebook, this means settings any field or destination dependent configuration.

Overrides FBAutopost::publishParameterPrepare

1 call to FBAutopostEntityEvent::publishParameterPrepare()
FBAutopostEntityEvent::remoteEntityEdit in fb_autopost_entity/class/FBAutopostEntityEvent.php
Edits a publication in facebook from a stored entity. Events in Facebook can actually be updated, this means that there is no deletion needed.

File

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

Class

FBAutopostEntityEvent
Special case for FacebookPublicationType Event

Code

protected function publishParameterPrepare(&$publication) {
  parent::publishParameterPrepare($publication);
  if (is_numeric($publication['params']['start_time'])) {
    $start = new DateTime('@' . $publication['params']['start_time']);
    $publication['params']['start_time'] = $start
      ->format(DateTime::ISO8601);
  }
  if (!empty($publication['params']['end_time']) && is_numeric($publication['params']['end_time'])) {
    $end = new DateTime('@' . $publication['params']['end_time']);
    $publication['params']['end_time'] = $end
      ->format(DateTime::ISO8601);
  }
}