/** * Displays details of a Historics query. * * @param DataSift_Historic $hist A DataSift Historics object */ public function displayHistoricDetails($hist) { echo 'Playback ID: ' . $hist->getHash() . PHP_EOL; echo 'Stream hash: ' . $hist->getStreamHash() . PHP_EOL; echo 'Name: ' . $hist->getName() . PHP_EOL; echo 'Start time: ' . date('r', $hist->getStartDate()) . PHP_EOL; echo 'End time: ' . date('r', $hist->getEndDate()) . PHP_EOL; $sources = $hist->getSources(); echo 'Source' . (count($sources) == 1 ? ': ' : 's:') . ' ' . implode(', ', $sources) . PHP_EOL; echo 'Sample: ' . $hist->getSample() . PHP_EOL; echo 'Created at: ' . (is_null($hist->getCreatedAt()) ? 'null' : date('r', $hist->getCreatedAt())) . PHP_EOL; echo 'Status: ' . $hist->getStatus() . PHP_EOL; }
/** * Subscribe this endpoint to a Historic. * * @param DataSift_Historic $historic The historic object to which to subscribe. * @param string $name A name for this subscription. * * @return DataSift_PushSubscription The new subscription. * @throws DataSift_Exception_InvalidData * @throws DataSift_Exception_AccessDenied * @throws DataSift_Exception_APIError */ public function subscribeHistoric($historic, $name) { return $this->subscribeHistoricPlaybackId($historic->getHash(), $name); }