diff --git a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php index 95c6324b95c6b2abe9a8689a344d23f212351e2c..7a4a698c18e2f3669331b998250b8faf12f5cd9a 100644 --- a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php +++ b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php @@ -7,6 +7,7 @@ namespace Drupal\aggregator\Plugin\aggregator\processor; +use Drupal\aggregator\Entity\Item; use Drupal\aggregator\ItemStorageInterface; use Drupal\aggregator\Plugin\AggregatorPluginSettingsBase; use Drupal\aggregator\Plugin\ProcessorInterface; @@ -215,7 +216,7 @@ public function process(FeedInterface $feed) { $entry = reset($entry); } else { - $entry = entity_create('aggregator_item', array('langcode' => $feed->language()->getId())); + $entry = Item::create(array('langcode' => $feed->language()->getId())); } if ($item['timestamp']) { $entry->setPostedTime($item['timestamp']); diff --git a/core/modules/aggregator/src/Tests/AggregatorTestBase.php b/core/modules/aggregator/src/Tests/AggregatorTestBase.php index d5b09e5256a5bd9bafe441cf79151f96df297376..13f0a77f979a61346149d9b26bc849cb0d9eda6b 100644 --- a/core/modules/aggregator/src/Tests/AggregatorTestBase.php +++ b/core/modules/aggregator/src/Tests/AggregatorTestBase.php @@ -137,7 +137,7 @@ public function getFeedEditObject($feed_url = NULL, array $values = array()) { 'url' => $feed_url, 'refresh' => '900', ); - return entity_create('aggregator_feed', $values); + return Feed::create($values); } /** diff --git a/core/modules/aggregator/src/Tests/FeedParserTest.php b/core/modules/aggregator/src/Tests/FeedParserTest.php index f507302a34c6bd9633f99dfe469dfe85dd6e6f07..8883089168894771e937637921298cbf2cbd9fc3 100644 --- a/core/modules/aggregator/src/Tests/FeedParserTest.php +++ b/core/modules/aggregator/src/Tests/FeedParserTest.php @@ -8,6 +8,7 @@ namespace Drupal\aggregator\Tests; use Drupal\Core\Url; +use Drupal\aggregator\Entity\Feed; /** * Tests the built-in feed parser with valid feed samples. @@ -89,7 +90,7 @@ public function testHtmlEntitiesSample() { */ public function testRedirectFeed() { $redirect_url = Url::fromRoute('aggregator_test.redirect')->setAbsolute()->toString(); - $feed = entity_create('aggregator_feed', array('url' => $redirect_url, 'title' => $this->randomMachineName())); + $feed = Feed::create(array('url' => $redirect_url, 'title' => $this->randomMachineName())); $feed->save(); $feed->refreshItems(); @@ -103,7 +104,7 @@ public function testRedirectFeed() { public function testInvalidFeed() { // Simulate a typo in the URL to force a curl exception. $invalid_url = 'http:/www.drupal.org'; - $feed = entity_create('aggregator_feed', array('url' => $invalid_url, 'title' => $this->randomMachineName())); + $feed = Feed::create(array('url' => $invalid_url, 'title' => $this->randomMachineName())); $feed->save(); // Update the feed. Use the UI to be able to check the message easily.