Пример #1
0
 /**
  * List of subscribers for this objct.
  * @param HISTORY_ITEM $history_item
  * @param AUDITABLE $obj
  * @return SUBSCRIBER[]
  */
 protected function _subscribers_for($history_item, $obj)
 {
     $query = $obj->subscriber_query($history_item);
     // Don't even bother retrieving disabled subscribers
     $query->restrict('min_hours_to_wait <> ' . Subscriptions_disabled);
     return $query->objects();
 }
Пример #2
0
 /**
  * How is the user subscribed to this object?
  * Returns a list of {@link Subscribe_constants} that match this person and the
  * given object.
  * @param AUDITABLE $obj
  * @return integer[]
  */
 public function receives_notifications_through($obj)
 {
     $Result = array();
     if (isset($this->email) && $obj->exists()) {
         $query = $obj->subscriber_query();
         $query->restrict("subscribers.email = '{$this->email}'");
         $query->set_select('subs.kind as subkind');
         $db = $query->raw_output();
         while ($db->next_record()) {
             $Result[] = $db->f('subkind');
         }
     }
     return $Result;
 }