original_string: public function Queue($Data, $Preference = FALSE, $Options = array()) {
        $this->_Touch($Data);
        if (!isset($Data['NotifyUserID']) || !isset($Data['ActivityType']))
           throw new Exception('Data missing NotifyUserID and/or ActivityType', 400);
        
        if ($Data['ActivityUserID'] == $Data['NotifyUserID'] && !GetValue('Force', $Options))
           return; // don't notify users of something they did.
        
        $Notified = $Data['Notified'];
        $Emailed = $Data['Emailed'];
        
        if (isset(self::$Queue[$Data['NotifyUserID']][$Data['ActivityType']])) {
           list($CurrentData, $CurrentOptions) = self::$Queue[$Data['NotifyUserID']][$Data['ActivityType']];
           
           $Notified = $Notified ? $Notified : $CurrentData['Notified'];
           $Emailed = $Emailed ? $Emailed : $CurrentData['Emailed'];
           $Data = array_merge($CurrentData, $Data);
           $Options = array_merge($CurrentOptions, $Options);
        }
        
        if ($Preference) {
           list($Popup, $Email) = self::NotificationPreference($Preference, $Data['NotifyUserID'], 'both');
           if (!$Popup && !$Email)
              return; // don't queue if user doesn't want to be notified at all.
           
           if ($Popup)
              $Notified = self::SENT_PENDING;
           if ($Email)
              $Emailed = self::SENT_PENDING;
        }
        $Data['Notified'] = $Notified;
        $Data['Emailed'] = $Emailed;
        
        self::$Queue[$Data['NotifyUserID']][$Data['ActivityType']] = array($Data, $Options);
     }
code: public function Queue($Data, $Preference = FALSE, $Options = array()) {
        $this->_Touch($Data);
        if (!isset($Data['NotifyUserID']) || !isset($Data['ActivityType']))
           throw new Exception('Data missing NotifyUserID and/or ActivityType', 400);
        
        if ($Data['ActivityUserID'] == $Data['NotifyUserID'] && !GetValue('Force', $Options))
           return; // don't notify users of something they did.
        
        $Notified = $Data['Notified'];
        $Emailed = $Data['Emailed'];
        
        if (isset(self::$Queue[$Data['NotifyUserID']][$Data['ActivityType']])) {
           list($CurrentData, $CurrentOptions) = self::$Queue[$Data['NotifyUserID']][$Data['ActivityType']];
           
           $Notified = $Notified ? $Notified : $CurrentData['Notified'];
           $Emailed = $Emailed ? $Emailed : $CurrentData['Emailed'];
           $Data = array_merge($CurrentData, $Data);
           $Options = array_merge($CurrentOptions, $Options);
        }
        
        if ($Preference) {
           list($Popup, $Email) = self::NotificationPreference($Preference, $Data['NotifyUserID'], 'both');
           if (!$Popup && !$Email)
              return; // don't queue if user doesn't want to be notified at all.
           
           if ($Popup)
              $Notified = self::SENT_PENDING;
           if ($Email)
              $Emailed = self::SENT_PENDING;
        }
        $Data['Notified'] = $Notified;
        $Data['Emailed'] = $Emailed;
        
        self::$Queue[$Data['NotifyUserID']][$Data['ActivityType']] = array($Data, $Options);
     }
code_tokens: public function Queue ( $ Data , $ Preference = FALSE , $ Options = array ( ) ) { $ this -> _Touch ( $ Data ) ; if ( ! isset ( $ Data [ 'NotifyUserID' ] ) || ! isset ( $ Data [ 'ActivityType' ] ) ) throw new Exception ( 'Data missing NotifyUserID and/or ActivityType' , 400 ) ; if ( $ Data [ 'ActivityUserID' ] == $ Data [ 'NotifyUserID' ] && ! GetValue ( 'Force' , $ Options ) ) return ; // don't notify users of something they did. $ Notified = $ Data [ 'Notified' ] ; $ Emailed = $ Data [ 'Emailed' ] ; if ( isset ( self :: $ Queue [ $ Data [ 'NotifyUserID' ] ] [ $ Data [ 'ActivityType' ] ] ) ) { list ( $ CurrentData , $ CurrentOptions ) = self :: $ Queue [ $ Data [ 'NotifyUserID' ] ] [ $ Data [ 'ActivityType' ] ] ; $ Notified = $ Notified ? $ Notified : $ CurrentData [ 'Notified' ] ; $ Emailed = $ Emailed ? $ Emailed : $ CurrentData [ 'Emailed' ] ; $ Data = array_merge ( $ CurrentData , $ Data ) ; $ Options = array_merge ( $ CurrentOptions , $ Options ) ; } if ( $ Preference ) { list ( $ Popup , $ Email ) = self :: NotificationPreference ( $ Preference , $ Data [ 'NotifyUserID' ] , 'both' ) ; if ( ! $ Popup && ! $ Email ) return ; // don't queue if user doesn't want to be notified at all. if ( $ Popup ) $ Notified = self :: SENT_PENDING ; if ( $ Email ) $ Emailed = self :: SENT_PENDING ; } $ Data [ 'Notified' ] = $ Notified ; $ Data [ 'Emailed' ] = $ Emailed ; self :: $ Queue [ $ Data [ 'NotifyUserID' ] ] [ $ Data [ 'ActivityType' ] ] = array ( $ Data , $ Options ) ; }
docstring: Queue an activity for saving later.
  @param array $Data The data in the activity.
  @param string|FALSE $Preference The name of the preference governing the activity.
  @param array $Options Additional options for saving.
  @return type
docstring_tokens: Queue an activity for saving later .