You are here

public static function HeartbeatStreamFactory::getStream in Heartbeat 7

1 call to HeartbeatStreamFactory::getStream()
heartbeat_stream in ./heartbeat.streams.inc
Prepares a heartbeat stream.

File

./heartbeat.streams.inc, line 201

Class

HeartbeatStreamFactory
Factory to return a stream object.

Code

public static function getStream($streamConfig, $page = 0, $account = NULL) {
  $className = !empty($streamConfig->real_class) ? $streamConfig->real_class : $streamConfig->class;
  if (class_exists($className)) {
    return new $className($streamConfig, $page, $account);
  }
  else {
    throw new HeartbeatInvalidStreamException(t('Stream class @class does not exist in @path or it\'s not auto-included in yourmodule.info.', array(
      '@class' => $streamConfig->class,
      '@path' => $streamConfig->path,
    )), 1000, 'stream does not exist');
  }
}