diff --git a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php index a42c39a..5c2dff9 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; @@ -216,7 +217,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 3c5a452..9d4d5f3 100644 --- a/core/modules/aggregator/src/Tests/AggregatorTestBase.php +++ b/core/modules/aggregator/src/Tests/AggregatorTestBase.php @@ -135,7 +135,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 371b10f..2c193e0 100644 --- a/core/modules/aggregator/src/Tests/FeedParserTest.php +++ b/core/modules/aggregator/src/Tests/FeedParserTest.php @@ -7,6 +7,7 @@ namespace Drupal\aggregator\Tests; +use Drupal\aggregator\Entity\Feed; use Drupal\Core\Url; use Zend\Feed\Reader\Reader; @@ -86,7 +87,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(); @@ -100,7 +101,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. diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php index 9e075ba..6192203 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php @@ -7,6 +7,7 @@ namespace Drupal\migrate_drupal\Tests\d6; +use Drupal\aggregator\Entity\Feed; use Drupal\aggregator\Entity\Item; use Drupal\Core\Language\LanguageInterface; use Drupal\migrate\MigrateExecutable; @@ -37,7 +38,7 @@ protected function setUp() { ); $this->prepareMigrations($id_mappings); - $entity = entity_create('aggregator_feed', array( + $entity = Feed::create(array( 'fid' => 5, 'title' => 'Drupal Core', 'url' => 'https://groups.drupal.org/not_used/167169',