You are here

protected function FeedsExecutable::doClean in Feeds 8.3

Cleans an entity.

Parameters

\Drupal\feeds\FeedInterface $feed: The feed to perform a clean event on.

1 call to FeedsExecutable::doClean()
FeedsExecutable::processItem in src/FeedsExecutable.php
Processes a stage of an import.

File

src/FeedsExecutable.php, line 277

Class

FeedsExecutable
Defines a feeds executable class.

Namespace

Drupal\feeds

Code

protected function doClean(FeedInterface $feed) {
  $state = $feed
    ->getState(StateInterface::CLEAN);
  $entity = $state
    ->nextEntity();
  if ($entity) {
    $this
      ->dispatchEvent(FeedsEvents::INIT_IMPORT, new InitEvent($feed, 'clean'));
    $this
      ->dispatchEvent(FeedsEvents::CLEAN, new CleanEvent($feed, $entity));
  }
  if (!$state
    ->count()) {
    $state
      ->setCompleted();
  }
  $feed
    ->saveStates();
}