diff --git a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php index 52b1ff70956cdaad5e090caf28f0caf69ddcb779..0aae903d3bc430e5c6cc31dbac0cdccf1364fa9d 100644 --- a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php +++ b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php @@ -10,6 +10,7 @@ use Drupal\Core\Database\Query\AlterableInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\views\Views; +use Drupal\views\Entity\View; /** * Relationship handler that allows a groupwise maximum of the linked in table. @@ -156,7 +157,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { * We use this to obtain our subquery SQL. */ protected function getTemporaryView() { - $view = entity_create('view', array('base_table' => $this->definition['base'])); + $view = View::create(array('base_table' => $this->definition['base'])); $view->addDisplay('default'); return $view->getExecutable(); } diff --git a/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php b/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php index 95acc95a947cbd268c921859f091d60af9008537..bb0aff87f986cbbc3ec7ede9c1d332d98aba9df3 100644 --- a/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php +++ b/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php @@ -660,7 +660,7 @@ protected function instantiateView($form, FormStateInterface $form_state) { 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->getId(), ); - $view = entity_create('view', $values); + $view = View::create($values); // Build all display options for this view. $display_options = $this->buildDisplayOptions($form, $form_state); diff --git a/core/modules/views/src/Tests/Handler/HandlerAllTest.php b/core/modules/views/src/Tests/Handler/HandlerAllTest.php index 84579a835e246caafaafcd649a159d2838f718b3..4c321a85d4defde6ca84c6abc60c125be1227a61 100644 --- a/core/modules/views/src/Tests/Handler/HandlerAllTest.php +++ b/core/modules/views/src/Tests/Handler/HandlerAllTest.php @@ -11,6 +11,7 @@ use Drupal\views\ViewExecutable; use Drupal\views\Plugin\views\HandlerBase; use Drupal\views\Plugin\views\filter\InOperator; +use Drupal\views\Entity\View; /** * Tests instances of all handlers. @@ -59,7 +60,7 @@ public function testHandlers() { continue; } - $view = entity_create('view', array('base_table' => $base_table)); + $view = View::create(array('base_table' => $base_table)); $view = $view->getExecutable(); // @todo The groupwise relationship is currently broken. diff --git a/core/modules/views/src/Tests/Plugin/DisplayTest.php b/core/modules/views/src/Tests/Plugin/DisplayTest.php index 05170638f7379dccbc11b0f0b901c38a7e64542b..cae25a9d72e4178c699fbf0d6c91076007b113ce 100644 --- a/core/modules/views/src/Tests/Plugin/DisplayTest.php +++ b/core/modules/views/src/Tests/Plugin/DisplayTest.php @@ -8,6 +8,7 @@ namespace Drupal\views\Tests\Plugin; use Drupal\language\Entity\ConfigurableLanguage; +use Drupal\views\Entity\View; use Drupal\views\Views; use Drupal\views_test_data\Plugin\views\display\DisplayTest as DisplayTestPlugin; @@ -230,7 +231,7 @@ public function testReadMore() { $this->assertTrue(empty($result), 'The more link is not shown when view has more records.'); // Test the default value of use_more_always. - $view = entity_create('view')->getExecutable(); + $view = View::create()->getExecutable(); $this->assertTrue($view->getDisplay()->getOption('use_more_always'), 'Always display the more link by default.'); } diff --git a/core/modules/views_ui/src/Tests/TagTest.php b/core/modules/views_ui/src/Tests/TagTest.php index b18ee98ae979b91f1e98aca7af7e7018c2f73851..ffb6077dd700daae8757d660aa09a64fca2c40c3 100644 --- a/core/modules/views_ui/src/Tests/TagTest.php +++ b/core/modules/views_ui/src/Tests/TagTest.php @@ -10,6 +10,7 @@ use Drupal\views\Tests\ViewKernelTestBase; use Drupal\views_ui\Controller\ViewsUIController; use Drupal\Component\Utility\Html; +use Drupal\views\Entity\View; /** * Tests the views ui tagging functionality. @@ -37,7 +38,7 @@ public function testViewsUiAutocompleteTag() { $suffix = $i % 2 ? 'odd' : 'even'; $tag = 'autocomplete_tag_test_' . $suffix . $this->randomMachineName(); $tags[] = $tag; - entity_create('view', array('tag' => $tag, 'id' => $this->randomMachineName()))->save(); + View::create(array('tag' => $tag, 'id' => $this->randomMachineName()))->save(); } // Make sure just ten results are returns.