You are here

private function FeedsDrushCommands::getFeed in Feeds 8.3

Get the feed entity by ID.

Parameters

int $fid: The ID of the feed.

Return value

\Drupal\Core\Entity\EntityInterface|null The Feed entity when loaded successfully, null otherwise.

5 calls to FeedsDrushCommands::getFeed()
FeedsDrushCommands::disableFeed in src/Commands/FeedsDrushCommands.php
Disable a feed specified by its id.
FeedsDrushCommands::enableFeed in src/Commands/FeedsDrushCommands.php
Enable a feed specified by its id.
FeedsDrushCommands::importFeed in src/Commands/FeedsDrushCommands.php
Import a feed specified by its id.
FeedsDrushCommands::lockFeed in src/Commands/FeedsDrushCommands.php
Lock a feed specified by its id.
FeedsDrushCommands::unlockFeed in src/Commands/FeedsDrushCommands.php
Unlock a feed specified by its id.

File

src/Commands/FeedsDrushCommands.php, line 293

Class

FeedsDrushCommands
Defines Drush commands for the Feeds module.

Namespace

Drupal\feeds\Commands

Code

private function getFeed($fid) {
  try {

    // Load the feed entity.
    return \Drupal::entityTypeManager()
      ->getStorage('feeds_feed')
      ->load($fid);
  } catch (InvalidPluginDefinitionException $e) {
    $this->logger
      ->error($e
      ->getMessage());
  } catch (PluginNotFoundException $e) {
    $this->logger
      ->error($e
      ->getMessage());
  }

  // An error seems to have occurred when getting here, return null.
  return NULL;
}