abstract class FeedsFetcher in Feeds 6
Same name and namespace in other branches
- 7.2 plugins/FeedsFetcher.inc \FeedsFetcher
- 7 plugins/FeedsFetcher.inc \FeedsFetcher
Abstract class, defines shared functionality between fetchers.
Implements FeedsSourceInfoInterface to expose source forms to Feeds.
Hierarchy
- class \FeedsConfigurable- class \FeedsPlugin implements FeedsSourceInterface- class \FeedsFetcher
 
 
- class \FeedsPlugin implements FeedsSourceInterface
Expanded class hierarchy of FeedsFetcher
3 string references to 'FeedsFetcher'
- feeds_plugin_type in ./feeds.module 
- Determines the type of a plugin.
- hook_feeds_plugins in ./feeds.api.php 
- A hook_feeds_plugins() declares available Fetcher, Parser or Processor plugins to Feeds. For an example look at feeds_feeds_plugin(). For exposing this hook hook_ctools_plugin_api() MUST be implemented, too.
- _feeds_feeds_plugins in ./feeds.plugins.inc 
- Break out for feeds_feed_plugins().
File
- plugins/FeedsFetcher.inc, line 8 
View source
abstract class FeedsFetcher extends FeedsPlugin {
  /**
   * Fetch content from a source and return it.
   *
   * Every class that extends FeedsFetcher must implement this method.
   *
   * @param $source
   *   Source value as entered by user through sourceForm().
   */
  public abstract function fetch(FeedsSource $source);
  /**
   * Clear all caches for results for given source.
   *
   * @param FeedsSource $source
   *   Source information for this expiry. Implementers can choose to only clear
   *   caches pertaining to this source.
   */
  public function clear(FeedsSource $source) {
  }
  /**
   * Request handler invoked if callback URL is requested. Locked down by
   * default. For a example usage see FeedsHTTPFetcher.
   *
   * Note: this method may exit the script.
   *
   * @return
   *   A string to be returned to the client.
   */
  public function request($feed_nid = 0) {
    drupal_access_denied();
  }
  /**
   * Construct a path for a concrete fetcher/source combination. The result of
   * this method matches up with the general path definition in
   * FeedsFetcher::menuItem(). For example usage look at FeedsHTTPFetcher.
   *
   * @return
   *   Path for this fetcher/source combination.
   */
  public function path($feed_nid = 0) {
    $id = urlencode($this->id);
    if ($feed_nid && is_numeric($feed_nid)) {
      return "feeds/importer/{$id}/{$feed_nid}";
    }
    return "feeds/importer/{$id}";
  }
  /**
   * Menu item definition for fetchers of this class. Note how the path
   * component in the item definition matches the return value of
   * FeedsFetcher::path();
   *
   * Requests to this menu item will be routed to FeedsFetcher::request().
   *
   * @return
   *   An array where the key is the Drupal menu item path and the value is
   *   a valid Drupal menu item definition.
   */
  public function menuItem() {
    return array(
      'feeds/importer/%feeds_importer' => array(
        'page callback' => 'feeds_fetcher_callback',
        'page arguments' => array(
          2,
          3,
        ),
        'access callback' => TRUE,
        'file' => 'feeds.pages.inc',
        'type' => MENU_CALLBACK,
      ),
    );
  }
  /**
   * Subscribe to a source. Only implement if fetcher requires subscription.
   *
   * @param FeedsSource $source
   *   Source information for this subscription.
   */
  public function subscribe(FeedsSource $source) {
  }
  /**
   * Unsubscribe from a source. Only implement if fetcher requires subscription.
   *
   * @param FeedsSource $source
   *   Source information for unsubscribing.
   */
  public function unsubscribe(FeedsSource $source) {
  }
  /**
   * Override import period settings. This can be used to force a certain import
   * interval.
   *
   * @param $source
   *   A FeedsSource object.
   *
   * @return
   *   A time span in seconds if periodic import should be overridden for given
   *   $source, NULL otherwise.
   */
  public function importPeriod(FeedsSource $source) {
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| FeedsConfigurable:: | protected | property | ||
| FeedsConfigurable:: | protected | property | CTools export enabled status of this object. | |
| FeedsConfigurable:: | protected | property | ||
| FeedsConfigurable:: | protected | property | ||
| FeedsConfigurable:: | public | function | Similar to setConfig but adds to existing configuration. | 1 | 
| FeedsConfigurable:: | public | function | Return default configuration. | 6 | 
| FeedsConfigurable:: | public | function | Return configuration form for this object. The keys of the configuration form must match the keys of the array returned by configDefaults(). | 10 | 
| FeedsConfigurable:: | public | function | Submission handler for configForm(). | 3 | 
| FeedsConfigurable:: | public | function | Validation handler for configForm(). | 3 | 
| FeedsConfigurable:: | public | function | Copy a configuration. | 1 | 
| FeedsConfigurable:: | public | function | Determine whether this object is persistent and enabled. I. e. it is defined either in code or in the database and it is enabled. | 1 | 
| FeedsConfigurable:: | public | function | Implementation of getConfig(). | 1 | 
| FeedsConfigurable:: | public static | function | Instantiate a FeedsConfigurable object. | 1 | 
| FeedsConfigurable:: | public | function | Set configuration. | 1 | 
| FeedsConfigurable:: | public | function | Override magic method __get(). Make sure that $this->config goes through getConfig() | |
| FeedsConfigurable:: | public | function | Override magic method __isset(). This is needed due to overriding __get(). | |
| FeedsFetcher:: | public | function | Clear all caches for results for given source. | 1 | 
| FeedsFetcher:: | abstract public | function | Fetch content from a source and return it. | 2 | 
| FeedsFetcher:: | public | function | Override import period settings. This can be used to force a certain import interval. | 1 | 
| FeedsFetcher:: | public | function | Menu item definition for fetchers of this class. Note how the path component in the item definition matches the return value of FeedsFetcher::path(); | |
| FeedsFetcher:: | public | function | Construct a path for a concrete fetcher/source combination. The result of this method matches up with the general path definition in FeedsFetcher::menuItem(). For example usage look at FeedsHTTPFetcher. | |
| FeedsFetcher:: | public | function | Request handler invoked if callback URL is requested. Locked down by default. For a example usage see FeedsHTTPFetcher. | 1 | 
| FeedsFetcher:: | public | function | Subscribe to a source. Only implement if fetcher requires subscription. | 1 | 
| FeedsFetcher:: | public | function | Unsubscribe from a source. Only implement if fetcher requires subscription. | 1 | 
| FeedsPlugin:: | public | function | Returns TRUE if $this->sourceForm() returns a form. Overrides FeedsSourceInterface:: | |
| FeedsPlugin:: | protected static | function | Loads on-behalf implementations from mappers/ directory. | |
| FeedsPlugin:: | public | function | Save changes to the configuration of this object.
Delegate saving to parent (= Feed) which will collect
information from this object by way of getConfig() and store it. Overrides FeedsConfigurable:: | |
| FeedsPlugin:: | public | function | Implementation of FeedsSourceInterface::sourceDefaults(). Overrides FeedsSourceInterface:: | 1 | 
| FeedsPlugin:: | public | function | A source is being deleted. Overrides FeedsSourceInterface:: | 1 | 
| FeedsPlugin:: | public | function | Callback methods, exposes source form. Overrides FeedsSourceInterface:: | 3 | 
| FeedsPlugin:: | public | function | Validation handler for sourceForm. Overrides FeedsSourceInterface:: | 2 | 
| FeedsPlugin:: | public | function | A source is being saved. Overrides FeedsSourceInterface:: | 1 | 
| FeedsPlugin:: | protected | function | Constructor. Overrides FeedsConfigurable:: | 
