/**
  * Apply class-specific restrictions to this query.
  * @param SUBSCRIPTION_QUERY $query
  * @param HISTORY_ITEM $history_item Action that generated this request. May be empty.
  * @access private
  */
 protected function _prepare_subscription_query($query, $history_item)
 {
     $entry = $this->entry();
     $folder = $this->parent_folder();
     // If it's a change, grab the job id
     if (isset($entry->job_id)) {
         $job_id = $entry->job_id;
     } else {
         $job_id = 0;
     }
     $query->restrict('watch_comments > 0');
     $query->restrict_kinds(array(Subscribe_folder => $folder->id, Subscribe_entry => $job_id, Subscribe_entry => $this->entry_id, Subscribe_comment => $this->parent_id, Subscribe_comment => $this->id, Subscribe_user => $this->creator_id));
 }
Beispiel #2
0
 /**
  * Apply class-specific restrictions to this query.
  * @param SUBSCRIPTION_QUERY $query
  * @param HISTORY_ITEM $history_item Action that generated this request. May be empty.
  * @access private
  */
 protected function _prepare_subscription_query($query, $history_item)
 {
     $branch = $this->branch();
     $query->restrict('watch_entries > 0');
     $query->restrict_kinds(array(Subscribe_folder => $branch->parent_folder_id(), Subscribe_user => $this->creator_id));
 }
Beispiel #3
0
 /**
  * Apply class-specific restrictions to this query.
  * @param SUBSCRIPTION_QUERY $query
  * @param HISTORY_ITEM $history_item Action that generated this request. May be empty.
  * @access private
  */
 protected function _prepare_subscription_query($query, $history_item)
 {
     $query->restrict('watch_entries > 0');
     $query->restrict_kinds(array(Subscribe_user => $this->id));
 }
 /**
  * Apply class-specific restrictions to this query.
  * @param SUBSCRIPTION_QUERY $query
  * @param HISTORY_ITEM $history_item Action that generated this request. May be empty.
  * @access private
  */
 protected function _prepare_subscription_query($query, $history_item)
 {
     $folder = $this->parent_folder();
     $host = $this->host();
     switch ($this->type) {
         case History_item_comment:
             $query->restrict('watch_comments > 0');
             $query->restrict_kinds(array(Subscribe_folder => $folder->id, Subscribe_entry => $host->entry_id, Subscribe_comment => $host->parent_id, Subscribe_comment => $host->id, Subscribe_user => $this->creator_id));
             break;
         case History_item_entry:
             $query->restrict('watch_entries > 0');
             $query->restrict_kinds(array(Subscribe_folder => $folder->id, Subscribe_entry => $host->id, Subscribe_user => $this->creator_id));
             break;
         case History_item_folder:
             $query->restrict('watch_entries > 0');
             $query->restrict_kinds(array(Subscribe_folder => $this->id, Subscribe_user => $this->creator_id));
             break;
     }
 }
Beispiel #5
0
 /**
  * Apply class-specific restrictions to this query.
  * @param SUBSCRIPTION_QUERY $query
  * @param HISTORY_ITEM $history_item Action that generated this request. May be empty.
  * @access private
  */
 protected function _prepare_subscription_query($query, $history_item)
 {
     $folder = $this->parent_folder();
     $query->restrict('watch_comments > 0');
     $query->restrict_kinds(array(Subscribe_folder => $folder->id, Subscribe_entry => $this->entry_id, Subscribe_comment => $this->parent_id, Subscribe_comment => $this->id, Subscribe_user => $this->creator_id));
 }