You are here

class HeartbeatFlagPlugin in Heartbeat 7

HeartbeatFlagPlugin abstract class.

Hierarchy

Expanded class hierarchy of HeartbeatFlagPlugin

File

modules/heartbeat_plugins/includes/heartbeatflagplugin.inc, line 49
Heartbeat Flag Base Plugin and some required utility functions.

View source
class HeartbeatFlagPlugin extends HeartbeatBasePlugin {

  /**
   * hasFlagDefinitions().
   * Defines if the plugin hasFlagDefinitions.
   */
  public function hasFlagDefinitions() {
    return TRUE;
  }

  /**
   * flagDefinitions().
   * Defines the flag definition.
   */
  public function flagDefinitions() {
    return array();
  }

  /**
   * hasDefaultFlags().
   * Defines if the plugin has default flags.
   */
  public function hasDefaultFlags() {
    return TRUE;
  }

  /**
   * flagDefaults().
   * Defines the default flags.
   */
  public function flagDefaults() {
    return array();
  }

  /**
   * removeFlagContent().
   */
  public function removeFlagContent($activityId) {
    db_delete('flag_content')
      ->condition('content_type', 'heartbeat_activity')
      ->condition('content_id', $activityId)
      ->execute();
  }

  /**
   * activityRemoved()
   */
  public function activityRemoved($uaids, $all) {
    foreach (array(
      'flag_content',
      'flag_counts',
    ) as $table) {
      $query = db_delete($table);
      $query
        ->condition('content_type', 'heartbeat_activity');
      if (!empty($uaids) && $all == FALSE) {
        $query
          ->condition('content_id', $uaids, 'IN');
      }
      $query
        ->execute();
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
HeartbeatBasePlugin::$label protected property
HeartbeatBasePlugin::$settings protected property
HeartbeatBasePlugin::$stream protected property
HeartbeatBasePlugin::addSettings public function addSettings().
HeartbeatBasePlugin::getAttachments public function getAttachments(). 2
HeartbeatBasePlugin::getLabel public function getLabel().
HeartbeatBasePlugin::getMenuItems public function getMenuItems(). 1
HeartbeatBasePlugin::getSettings public function getSettings().
HeartbeatBasePlugin::pluginAttachmentForm public function pluginAttachmentForm(). The form to add attachments to templates. 2
HeartbeatBasePlugin::pluginStreamForm public function pluginStreamForm(). 2
HeartbeatBasePlugin::pluginUIForm public function pluginUIForm(). 2
HeartbeatBasePlugin::setLabel public function setLabel().
HeartbeatBasePlugin::setStream final public function setStream().
HeartbeatBasePlugin::__construct public function __construct(). 1
HeartbeatFlagPlugin::activityRemoved public function activityRemoved() Overrides HeartbeatBasePlugin::activityRemoved
HeartbeatFlagPlugin::flagDefaults public function flagDefaults(). Defines the default flags. 1
HeartbeatFlagPlugin::flagDefinitions public function flagDefinitions(). Defines the flag definition. 1
HeartbeatFlagPlugin::hasDefaultFlags public function hasDefaultFlags(). Defines if the plugin has default flags.
HeartbeatFlagPlugin::hasFlagDefinitions public function hasFlagDefinitions(). Defines if the plugin hasFlagDefinitions.
HeartbeatFlagPlugin::removeFlagContent public function removeFlagContent().