You are here

public function ProductProcessorTest::afterParse in Commerce Feeds 8

Acts on parser result.

Parameters

\Drupal\feeds\Event\ParseEvent $event: The parse event.

File

tests/src/Kernel/Processor/ProductProcessorTest.php, line 125

Class

ProductProcessorTest
@coversDefaultClass \Drupal\commerce_feeds\Feeds\Processor\ProductProcessor @group commerce_feeds

Namespace

Drupal\Tests\commerce_feeds\Kernel\Processor

Code

public function afterParse(ParseEvent $event) {

  /** @var \Drupal\feeds\Feeds\Item\ItemInterface $item */
  foreach ($event
    ->getParserResult() as $item) {

    // Make sku multivalued by exploding on '|'.
    $item
      ->set('sku', explode('|', $item
      ->get('sku')));
  }
}