public function FeedsSource::existing in Feeds 8.2
Only return source if configuration is persistent and valid.
Overrides FeedsConfigurable::existing
See also
FeedsConfigurable::existing().
File
- lib/
Drupal/ feeds/ FeedsSource.php, line 496 - Definition of FeedsSourceInterface and FeedsSource class.
Class
- FeedsSource
- This class encapsulates a source of a feed. It stores where the feed can be found and how to import it.
Namespace
Drupal\feedsCode
public function existing() {
// If there is no feed nid given, there must be no content type specified.
// If there is a feed nid given, there must be a content type specified.
// Ensure that importer is persistent (= defined in code or DB).
// Ensure that source is persistent (= defined in DB).
return $this;
if (empty($this->feed_nid) && empty($this->importer->config['content_type']) || !empty($this->feed_nid) && !empty($this->importer->config['content_type'])) {
$this->importer
->existing();
return parent::existing();
}
throw new FeedsNotExistingException(t('Source configuration not valid.'));
}