source_config = $this->sourceDefaults(); } /** * 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. */ public function save() { feeds_importer($this->id)->save(); } /** * Returns TRUE if $this->sourceForm() returns a form. */ public function hasSourceConfig() { $form = $this->sourceForm(array()); return !empty($form); } /** * Implementation of FeedsSourceInterface::sourceDefaults(). */ public function sourceDefaults() { $values = array_flip(array_keys($this->sourceForm(array()))); foreach ($values as $k => $v) { $values[$k] = ''; } return $values; } /** * Callback methods, exposes source form. */ public function sourceForm($source_config) { return array(); } /** * Validation handler for sourceForm. */ public function sourceFormValidate(&$values) {} } /** * Used when a plugin is missing. */ class FeedsMissingPlugin extends FeedsPlugin { }