/** * Constructs an UploadFetcher object. * * @param array $configuration * The plugin configuration. * @param string $plugin_id * The plugin id. * @param array $plugin_definition * The plugin definition. * @param \Drupal\Core\Queue\QueueInterface $subscribe_queue * The queue to use for subscriptions. * @param \Drupal\Core\Queue\QueueInterface $unsubscribe_queue * The queue to use to unsubscribe. * @param \Drupal\feeds\PuSH\SubscriptionInterface $subscription * The subscription controller. */ public function __construct(array $configuration, $plugin_id, array $plugin_definition, QueueInterface $subscribe_queue, QueueInterface $unsubscribe_queue, SubscriptionInterface $subscription) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->subscribeQueue = $subscribe_queue; $this->unsubscribeQueue = $unsubscribe_queue; $this->subscription = $subscription; }
/** * {@inheritdoc} */ public function submitConfigurationForm(array &$form, array &$form_state) { if (!$this->jobController) { return; } $values =& $form_state['values']['scheduler']['configuration']; if ($this->configuration['import_period'] != $values['import_period']) { $this->importer->reschedule($this->importer->id()); } // Intentionally call parent last so that we can access our old values. parent::submitConfigurationForm($form, $form_state); }
/** * Constructs an UploadFetcher object. * * @param array $configuration * The plugin configuration. * @param string $plugin_id * The plugin id. * @param \Drupal\file\FileUsage\FileUsageInterface $file_usage * The file usage backend. * @param \Drupal\Core\Entity\EntityStorageControllerInterface $file_storage * The file storage controller. */ public function __construct(array $configuration, $plugin_id, array $plugin_definition, FileUsageInterface $file_usage, EntityStorageControllerInterface $file_storage) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->fileUsage = $file_usage; $this->fileStorage = $file_storage; }
/** * {@inheritdoc} */ public function submitConfigurationForm(array &$form, array &$form_state) { parent::submitConfigurationForm($form, $form_state); }
/** * {@inheritdoc} */ public function getSourceElement(FeedInterface $feed, array $item, $element_key) { return parent::getSourceElement($feed, $item, Unicode::strtolower($element_key)); }
/** * Constructs an UploadFetcher object. * * @param array $configuration * The plugin configuration. * @param string $plugin_id * The plugin id. * @param array $plugin_definition * The plugin definition. * @param \Drupal\file\FileUsage\FileUsageInterface $file_usage * The file usage backend. * @param \Drupal\Core\Entity\EntityManagerInterface $file_storage * The file storage controller. * @param \Drupal\Component\Uuid\UuidInterface $uuid * The UUID generator. * @param \Drupal\Core\StreamWrapper\StreamWrapperManager $stream_wrapper_manager * The stream wrapper manager. */ public function __construct(array $configuration, $plugin_id, array $plugin_definition, FileUsageInterface $file_usage, EntityManagerInterface $entity_manager, UuidInterface $uuid, StreamWrapperManager $stream_wrapper_manager) { $this->fileUsage = $file_usage; $this->fileStorage = $entity_manager->getStorage('file'); $this->uuid = $uuid; $this->streamWrapperManager = $stream_wrapper_manager; parent::__construct($configuration, $plugin_id, $plugin_definition); }
/** * {@inheritdoc} * * @todo We need an importer save/update/delete API. */ public function submitConfigurationForm(array &$form, array &$form_state) { $this->apply(__FUNCTION__, $form, $form_state); $values =& $form_state['values']['processor']['configuration']; if ($this->configuration['expire'] != $values['expire']) { $this->importer->reschedule($this->importer->id()); } parent::submitConfigurationForm($form, $form_state); $this->prepareFeedsItemField(); }