Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 protected function findEntity($value)
 {
     if ($term_id = parent::findEntity($value)) {
         return $term_id;
     }
     $term = $this->termStorage->create(array('vid' => 'tags', 'name' => $value));
     $term->save();
     return $term->id();
 }
Beispiel #2
0
 /**
  * Deletes a file.
  *
  * @param int $file_id
  *   The file id.
  * @param int $feed_id
  *   The feed id.
  *
  * @see file_delete()
  */
 protected function deleteFile($file_id, $feed_id)
 {
     if ($file = $this->fileStorage->load($file_id)) {
         $this->fileUsage->delete($file, 'feeds', $this->pluginType(), $feed_id);
     }
 }
Beispiel #3
0
 /**
  * {@inheritdoc}
  */
 protected function entityDeleteMultiple(array $entity_ids)
 {
     $entities = $this->storageController->loadMultiple($entity_ids);
     $this->storageController->delete($entities);
 }
 /**
  * Determines if the importer already exists.
  *
  * @param string $id
  *   The importer ID.
  *
  * @return bool
  *   True if the importer exists, false otherwise.
  */
 public function exists($id)
 {
     return (bool) $this->importerStorage->load($id);
 }
Beispiel #5
0
 /**
  * {@inheritdoc}
  */
 public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE)
 {
     // Alert implementers of FeedInterface to the fact that we're saving.
     foreach ($this->getImporter()->getPlugins() as $plugin) {
         $plugin->onFeedSave($this, $update);
     }
     // Store the source property of the fetcher in a separate column so that we
     // can do fast lookups on it.
     $this->set('source', $this->getSource());
     $storage_controller->updateFeedConfig($this);
 }