class RelationsActivity in Heartbeat 7
Class RelationsActivity Concrete class to build a stream with activity messages for all users that are connected to the viewed user.
Hierarchy
- class \HeartbeatStream
- class \RelationsActivity
 
 
Expanded class hierarchy of RelationsActivity
File
- modules/
heartbeat_defaults/ streams/ relationsactivity.inc, line 13  - User relations activity object.
 
View source
class RelationsActivity extends HeartbeatStream {
  /**
   * Fake constructor to hook this method instead of the constructor.
   */
  public function construct() {
    // Add the relations to the viewed user object.
    $this->viewer->relations = heartbeat_related_uids($this->viewer->uid);
    // This stream needs the viewed relations as well. Load them if different.
    if ($this->viewed->uid != $this->viewer->uid) {
      $this->viewed->relations = heartbeat_related_uids($this->viewed->uid);
    }
    else {
      $this->viewed->relations = $this->viewer->relations;
    }
  }
  /**
   * Implementation of queryAlter().
   */
  protected function queryAlter() {
    // This stream is limited to the messages owned by the "viewed" user
    // and his/her relations (friends, fans, ...).
    $this->query
      ->condition('ha.access', HEARTBEAT_PUBLIC_TO_ADDRESSEE, '>=');
    $this->query
      ->condition('ha.uid', $this->viewed->relations, 'IN');
  }
  /**
   * Function to add a part of a sql to a query built by views.
   * @param object $view
   *   The view handler object by reference to add our part to the query
   */
  public function viewsQueryAlter(&$view) {
    // This stream is limited to the messages owned by the "viewed" user
    // and his/her relations (friends, fans, ...).
    $query = $view->query;
    $query
      ->add_where(0, "access", HEARTBEAT_PUBLIC_TO_ADDRESSEE, ">=");
    $query
      ->add_where(0, "uid", $this->viewed->relations, 'IN');
  }
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  public | property | ||
| 
            HeartbeatStream:: | 
                  public | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  public | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  public | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  public | property | ||
| 
            HeartbeatStream:: | 
                  public | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  protected | property | ||
| 
            HeartbeatStream:: | 
                  public | function | addError | |
| 
            HeartbeatStream:: | 
                  public | function | canPostActivityStatuses(). TODO Remove this here. The stream plugins should be stored in the stream object. This kind of access will become much easier to implement. | |
| 
            HeartbeatStream:: | 
                  protected | function | Function to check access on messages This behaviour is set by a heartbeat message configuration to overrule the chosen display access type | |
| 
            HeartbeatStream:: | 
                  protected | function | createQuery(). | 1 | 
| 
            HeartbeatStream:: | 
                  public | function | excludeOg(). | |
| 
            HeartbeatStream:: | 
                  public | function | Function that reorganizes a query result of messages into a stream of heartbeat activity objects. | |
| 
            HeartbeatStream:: | 
                  protected | function | executeQuery | |
| 
            HeartbeatStream:: | 
                  public | function | executeViews(). | |
| 
            HeartbeatStream:: | 
                  public | function | getAjax(). | |
| 
            HeartbeatStream:: | 
                  public | function | getConfig(). | |
| 
            HeartbeatStream:: | 
                  public | function | getCurrentLanguages(). | |
| 
            HeartbeatStream:: | 
                  public | function | ||
| 
            HeartbeatStream:: | 
                  public | function | getLatestActivityId() | |
| 
            HeartbeatStream:: | 
                  public | function | Get the messages. | |
| 
            HeartbeatStream:: | 
                  final public | function | getOffsetTime | |
| 
            HeartbeatStream:: | 
                  final public | function | getTemplate(). | |
| 
            HeartbeatStream:: | 
                  public | function | getViewed(). | |
| 
            HeartbeatStream:: | 
                  public | function | getViewedId(). | |
| 
            HeartbeatStream:: | 
                  public | function | getViewer(). | |
| 
            HeartbeatStream:: | 
                  public | function | hasAccess | 4 | 
| 
            HeartbeatStream:: | 
                  public | function | hasErrors | |
| 
            HeartbeatStream:: | 
                  public | function | Function to check if more/older messages can be loaded | |
| 
            HeartbeatStream:: | 
                  public | function | isAjax(). | |
| 
            HeartbeatStream:: | 
                  public | function | isPage(). | |
| 
            HeartbeatStream:: | 
                  public | function | modifyActivityMessage() | 4 | 
| 
            HeartbeatStream:: | 
                  public | function | needsModal(). Returns a boolean to indicate whether modal window is needed on the page. | |
| 
            HeartbeatStream:: | 
                  public | function | numberOfMessages(). | |
| 
            HeartbeatStream:: | 
                  public | function | Create the well-formed activity messages from a result. HeartbeatParser will do most of the work here. | |
| 
            HeartbeatStream:: | 
                  public | function | Render(). | |
| 
            HeartbeatStream:: | 
                  public | function | result Prepares a query, makes it available to alter it and finally executes it. | |
| 
            HeartbeatStream:: | 
                  public | function | setAjax(). | |
| 
            HeartbeatStream:: | 
                  protected | function | setAvailableTemplates() | |
| 
            HeartbeatStream:: | 
                  public | function | setConfig(). | |
| 
            HeartbeatStream:: | 
                  protected | function | setContextualArguments(). | |
| 
            HeartbeatStream:: | 
                  protected | function | setError Alias for addError. | |
| 
            HeartbeatStream:: | 
                  public | function | setIsPage(). | |
| 
            HeartbeatStream:: | 
                  public | function | Set the maximum number of items to fetch. | |
| 
            HeartbeatStream:: | 
                  public | function | setLanguage(). | |
| 
            HeartbeatStream:: | 
                  public | function | setLatestActivityId(). | |
| 
            HeartbeatStream:: | 
                  final public | function | setOffsetTime | |
| 
            HeartbeatStream:: | 
                  public | function | setViewed(). | |
| 
            HeartbeatStream:: | 
                  public | function | setViewer(). | |
| 
            HeartbeatStream:: | 
                  public | function | setViewMode(). | |
| 
            HeartbeatStream:: | 
                  public | function | skipActiveUser(). | |
| 
            HeartbeatStream:: | 
                  constant | |||
| 
            HeartbeatStream:: | 
                  constant | |||
| 
            HeartbeatStream:: | 
                  final public | function | Constructor | |
| 
            RelationsActivity:: | 
                  public | function | 
            Fake constructor to hook this method instead of the constructor. Overrides HeartbeatStream:: | 
                  |
| 
            RelationsActivity:: | 
                  protected | function | 
            Implementation of queryAlter(). Overrides HeartbeatStream:: | 
                  |
| 
            RelationsActivity:: | 
                  public | function | 
            Function to add a part of a sql to a query built by views. Overrides HeartbeatStream:: |