You are here

class MailhandlerFetcherResult in Mailhandler 7.2

Definition of the import batch object needed by MailhandlerFetcher.

Hierarchy

Expanded class hierarchy of MailhandlerFetcherResult

File

plugins/feeds/plugins/MailhandlerFetcher.class.php, line 11
Checks for new messages in a mailbox (IMAP, POP3, etc...).

View source
class MailhandlerFetcherResult extends FeedsFetcherResult {
  protected $mailbox_name;
  protected $filter;

  /**
   * Constructor.
   */
  public function __construct($mailbox_name, $filter) {
    parent::__construct('');
    $this->mailbox_name = $mailbox_name;
    $this->filter = $filter;
  }

  /**
   * Implementation of FeedsImportBatch::getRaw();
   */
  public function getRaw() {
    $mailbox = mailhandler_mailbox_load($this->mailbox_name);
    if ($class = mailhandler_plugin_load_class('mailhandler', $mailbox->settings['retrieve'], 'retrieve', 'handler')) {
      if ($messages = $class
        ->retrieve($mailbox, $this->filter)) {
        return array(
          'messages' => $messages,
          'mailbox' => $mailbox,
        );
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FeedsFetcherResult::$file_path protected property The path to a file where the raw data is stored.
FeedsFetcherResult::$raw protected property The raw fetched data.
FeedsFetcherResult::checkFile protected function Checks that a file exists and is readable.
FeedsFetcherResult::constructFilePath public function Constructs file name for saving the raw data.
FeedsFetcherResult::fileExists public function Returns if the file to parse exists.
FeedsFetcherResult::getFeedsInProgressDir public function Returns directory for storing files that are in progress of import.
FeedsFetcherResult::getFileContents public function Returns the contents of a file, if it exists.
FeedsFetcherResult::getFilePath public function Get a path to a temporary file containing the resource provided by the fetcher. 1
FeedsFetcherResult::rawExists public function Returns if raw data exists.
FeedsFetcherResult::sanitizeFile public function Sanitize the file in place.
FeedsFetcherResult::sanitizeRaw public function Sanitize the raw content string.
FeedsFetcherResult::sanitizeRawOptimized public function Sanitize the raw content string.
FeedsFetcherResult::saveRawToFile public function Saves the raw fetcher result to a file.
FeedsFetcherResult::__sleep public function Prevent saving the raw result when serializing object.
MailhandlerFetcherResult::$filter protected property
MailhandlerFetcherResult::$mailbox_name protected property
MailhandlerFetcherResult::getRaw public function Implementation of FeedsImportBatch::getRaw(); Overrides FeedsFetcherResult::getRaw
MailhandlerFetcherResult::__construct public function Constructor. Overrides FeedsFetcherResult::__construct