You are here

public static function FeedImport::loadFeed in Feed Import 8

Loads a feed from database

Parameters

int|string $name: Feed machine name or id

Return value

object Feed object or FALSE

10 calls to FeedImport::loadFeed()
DeleteFeedForm::buildForm in src/Form/DeleteFeedForm.php
Form constructor.
DynamicFilterForm::buildForm in src/Form/DynamicFilterForm.php
Form constructor.
EditFeedForm::buildForm in src/Form/EditFeedForm.php
Form constructor.
FeedImportController::exportFeed in src/Controller/FeedImportController.php
Export feed.
FeedImportController::processFeed in src/Controller/FeedImportController.php
Process a feed

... See full list

File

feed_import_base/src/FeedImport.php, line 239

Class

FeedImport
This class provides helper functions for feed import.

Namespace

Drupal\feed_import_base

Code

public static function loadFeed($name) {
  $feed = db_select('feed_import_settings', 'f')
    ->fields('f')
    ->condition((int) $name ? 'id' : 'machine_name', $name, '=')
    ->range(0, 1)
    ->execute()
    ->fetchObject();
  if (!$feed) {
    return FALSE;
  }
  $feed->settings = unserialize($feed->settings);
  return $feed;
}