From c4fec19a1e93f59db17a8c89e944c9ef23dfd46a Mon Sep 17 00:00:00 2001 From: webchick Date: Wed, 26 Dec 2012 10:24:15 -0800 Subject: [PATCH] Issue #1871556 by tim.plunkett: Remove wrappers around entity_create(). --- .../Plugin/views/wizard/WizardPluginBase.php | 2 +- .../views/Tests/Handler/HandlerAllTest.php | 3 +-- .../lib/Drupal/views/Tests/UI/TagTest.php | 2 +- core/modules/views/views.module | 21 ------------------- 4 files changed, 3 insertions(+), 25 deletions(-) diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php index c977e84d9e8..f6b610ef373 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php @@ -633,7 +633,7 @@ abstract class WizardPluginBase extends PluginBase implements WizardInterface { 'base_table' => $this->base_table, ); - $view = views_create_view($values); + $view = entity_create('view', $values); // Build all display options for this view. $display_options = $this->build_display_options($form, $form_state); diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php index 7be896aadc2..7fe7636310a 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php @@ -58,8 +58,7 @@ class HandlerAllTest extends HandlerTestBase { continue; } - $view = views_new_view(); - $view->set('base_table', $base_table); + $view = entity_create('view', array('base_table' => $base_table)); $view = new ViewExecutable($view); // @todo The groupwise relationship is currently broken. diff --git a/core/modules/views/lib/Drupal/views/Tests/UI/TagTest.php b/core/modules/views/lib/Drupal/views/Tests/UI/TagTest.php index 06f668b012e..6c874236eee 100644 --- a/core/modules/views/lib/Drupal/views/Tests/UI/TagTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/UI/TagTest.php @@ -34,7 +34,7 @@ class TagTest extends ViewUnitTestBase { $suffix = $i % 2 ? 'odd' : 'even'; $tag = 'autocomplete_tag_test_' . $suffix . $this->randomName(); $tags[] = $tag; - views_create_view(array('tag' => $tag, 'name' => $this->randomName()))->save(); + entity_create('view', array('tag' => $tag, 'name' => $this->randomName()))->save(); } // Make sure just ten results are returns. diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 1783f164a8f..22b5ca8b26a 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -1313,27 +1313,6 @@ function views_get_enabled_display_extenders() { return drupal_map_assoc($enabled); } -/** - * Create an empty view to work with. - * - * @return Drupal\views\Plugin\Core\Entity\View - * A fully formed, empty $view object. This object must be populated before - * it can be successfully saved. - */ -function views_new_view() { - return entity_create('view', array()); -} - -/** - * Creates a view from an array of values. - * - * @return Drupal\views\Plugin\Core\Entity\View - * A fully formed $view object with properties from the values passed in. - */ -function views_create_view(array $values = array()) { - return entity_create('view', $values); -} - /** * Return a list of all views and display IDs that have a particular * setting in their display's plugin settings.