You are here

public function FeedsSource::existing in Feeds 7.2

Same name and namespace in other branches
  1. 6 includes/FeedsSource.inc \FeedsSource::existing()
  2. 7 includes/FeedsSource.inc \FeedsSource::existing()

Only return source if configuration is persistent and valid.

Overrides FeedsConfigurable::existing

See also

FeedsConfigurable::existing()

File

includes/FeedsSource.inc, line 1064
Definition of FeedsSourceInterface, FeedsState and FeedsSource class.

Class

FeedsSource
Holds the source of a feed to import.

Code

public function existing() {

  // Ensure that the source configuration is valid.
  if (!$this
    ->hasValidConfiguration()) {
    throw new FeedsNotExistingException(t('Source configuration not valid.'));
  }

  // Ensure that the importer is persistent (= defined in code or DB).
  $this->importer
    ->existing();

  // Ensure that the source is persistent (= defined in DB).
  return parent::existing();
}