You are here

class HeartbeatStreamFactory in Heartbeat 7

Factory to return a stream object.

Hierarchy

Expanded class hierarchy of HeartbeatStreamFactory

File

./heartbeat.streams.inc, line 199

View source
class HeartbeatStreamFactory {
  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');
    }
  }

}

Members