You are here

abstract class MediaFeedsProvider in Media Feeds 7

Same name and namespace in other branches
  1. 7.2 includes/MediaFeedsProvider.inc \MediaFeedsProvider

Base class for different Media Feeds providers.

Hierarchy

Expanded class hierarchy of MediaFeedsProvider

File

includes/MediaFeedsProvider.inc, line 11
The MediaFeedsProvider base class.

View source
abstract class MediaFeedsProvider {

  /**
   * The FeedsSource.
   */
  protected $source;

  /**
   * The target entity.
   */
  protected $entity;

  /**
   * The target name.
   */
  protected $target;

  /**
   * The values to save.
   */
  protected $value;

  /**
   * An associative array of configuration options.
   */
  protected $config;

  /**
   * Constructor of MediaFeedsProvider.
   *
   * @param $value
   *   The value to save.
   *
   * @param $config
   *   An associative array of configuration options.
   */
  public function __construct($value, $config = array()) {

    // Explicitly support FeedsEnclosure.
    if ($value instanceof FeedsEnclosure) {
      $value = $value
        ->getValue();
    }
    $this->value = $value;
    $this->config = $config;
  }

  /**
   * Validate the source value.
   */
  public function validate() {
  }

  /**
   * Create a file object from the source value.
   *
   * @return
   *   File object on success, FALSE on failure.
   */
  public abstract function getFileObject();

  /**
   * Save the file in the database.
   *
   * @return
   *   The file object as it has been saved or FALSE on failure.
   */
  public abstract function save();

}

Members

Namesort descending Modifiers Type Description Overrides
MediaFeedsProvider::$config protected property An associative array of configuration options.
MediaFeedsProvider::$entity protected property The target entity.
MediaFeedsProvider::$source protected property The FeedsSource.
MediaFeedsProvider::$target protected property The target name.
MediaFeedsProvider::$value protected property The values to save.
MediaFeedsProvider::getFileObject abstract public function Create a file object from the source value. 3
MediaFeedsProvider::save abstract public function Save the file in the database. 3
MediaFeedsProvider::validate public function Validate the source value. 1
MediaFeedsProvider::__construct public function Constructor of MediaFeedsProvider. 3