original_string: public static function get_subscriptions_by_event(\stdClass $event) {
          global $DB;
  
          $sql = self::get_subscription_join_rule_sql();
          if ($event->contextlevel == CONTEXT_MODULE && $event->contextinstanceid != 0) {
              $sql .= "WHERE r.eventname = :eventname AND s.courseid = :courseid AND (s.cmid = :cmid OR s.cmid = 0)";
              $params = array('eventname' => $event->eventname, 'courseid' => $event->courseid, 'cmid' => $event->contextinstanceid);
          } else {
              $sql .= "WHERE r.eventname = :eventname AND (s.courseid = :courseid OR s.courseid = 0)";
              $params = array('eventname' => $event->eventname, 'courseid' => $event->courseid);
          }
          return self::get_instances($DB->get_records_sql($sql, $params));
      }
code: public static function get_subscriptions_by_event(\stdClass $event) {
          global $DB;
  
          $sql = self::get_subscription_join_rule_sql();
          if ($event->contextlevel == CONTEXT_MODULE && $event->contextinstanceid != 0) {
              $sql .= "WHERE r.eventname = :eventname AND s.courseid = :courseid AND (s.cmid = :cmid OR s.cmid = 0)";
              $params = array('eventname' => $event->eventname, 'courseid' => $event->courseid, 'cmid' => $event->contextinstanceid);
          } else {
              $sql .= "WHERE r.eventname = :eventname AND (s.courseid = :courseid OR s.courseid = 0)";
              $params = array('eventname' => $event->eventname, 'courseid' => $event->courseid);
          }
          return self::get_instances($DB->get_records_sql($sql, $params));
      }
code_tokens: public static function get_subscriptions_by_event ( \ stdClass $ event ) { global $ DB ; $ sql = self :: get_subscription_join_rule_sql ( ) ; if ( $ event -> contextlevel == CONTEXT_MODULE && $ event -> contextinstanceid != 0 ) { $ sql .= "WHERE r.eventname = :eventname AND s.courseid = :courseid AND (s.cmid = :cmid OR s.cmid = 0)" ; $ params = array ( 'eventname' => $ event -> eventname , 'courseid' => $ event -> courseid , 'cmid' => $ event -> contextinstanceid ) ; } else { $ sql .= "WHERE r.eventname = :eventname AND (s.courseid = :courseid OR s.courseid = 0)" ; $ params = array ( 'eventname' => $ event -> eventname , 'courseid' => $ event -> courseid ) ; } return self :: get_instances ( $ DB -> get_records_sql ( $ sql , $ params ) ) ; }
docstring: Return a list of subscriptions for a given event.
  
  @param \stdClass $event the event object.
  
  @return array
docstring_tokens: Return a list of subscriptions for a given event .