diff --git a/core/includes/entity.inc b/core/includes/entity.inc index 7822d7a..772e0ef 100644 --- a/core/includes/entity.inc +++ b/core/includes/entity.inc @@ -388,7 +388,7 @@ function entity_delete_multiple($entity_type, array $ids) { function entity_create($entity_type, array $values) { return Drupal::entityManager() ->getStorageController($entity_type) - ->create($values); + ->createEntity($values); } /** diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 915f809..10c4942 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -2894,7 +2894,7 @@ function _menu_navigation_links_rebuild($menu) { $router_item['updated'] = $existing_item->updated; // Convert the existing item to a typed object. - $existing_item = $menu_link_controller->create(get_object_vars($existing_item)); + $existing_item = $menu_link_controller->createEntity(get_object_vars($existing_item)); } else { $existing_item = NULL; diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php index 8cfc060..6f58ce1 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php @@ -103,7 +103,7 @@ public function __construct($entity_type, array $entity_info, ConfigFactory $con /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, @@ -307,9 +307,9 @@ protected function attachLoad(&$queried_entities, $revision_id = FALSE) { } /** - * Implements Drupal\Core\Entity\EntityStorageControllerInterface::create(). + * Implements Drupal\Core\Entity\EntityStorageControllerInterface::createEntity(). */ - public function create(array $values) { + public function createEntity(array $values) { $class = $this->entityInfo['class']; $class::preCreate($this, $values); @@ -481,7 +481,7 @@ public function getQueryServicename() { * A configuration object containing the old configuration data. */ public function importCreate($name, Config $new_config, Config $old_config) { - $entity = $this->create($new_config->get()); + $entity = $this->createEntity($new_config->get()); $entity->save(); return TRUE; } diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php index bbf1ae0..45524e0 100644 --- a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php +++ b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php @@ -61,7 +61,7 @@ class DatabaseStorageController extends EntityStorageControllerBase { /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, @@ -360,9 +360,9 @@ protected function attachLoad(&$queried_entities, $load_revision = FALSE) { } /** - * Implements \Drupal\Core\Entity\EntityStorageControllerInterface::create(). + * Implements \Drupal\Core\Entity\EntityStorageControllerInterface::createEntity(). */ - public function create(array $values) { + public function createEntity(array $values) { $entity_class = $this->entityInfo['class']; $entity_class::preCreate($this, $values); diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php b/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php index ad361d7..240f5cb 100644 --- a/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php +++ b/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php @@ -71,7 +71,7 @@ public function __construct($entity_type, array $entity_info, Connection $databa } /** - * Overrides DatabaseStorageController::create(). + * Overrides DatabaseStorageController::createEntity(). * * @param array $values * An array of values to set, keyed by field name. The value has to be @@ -96,7 +96,7 @@ public function __construct($entity_type, array $entity_info, Connection $databa * @return \Drupal\Core\Entity\EntityInterface * A new entity object. */ - public function create(array $values) { + public function createEntity(array $values) { $entity_class = $this->entityClass; $entity_class::preCreate($this, $values); diff --git a/core/lib/Drupal/Core/Entity/EntityControllerInterface.php b/core/lib/Drupal/Core/Entity/EntityControllerInterface.php index 79232c1..9d2e466 100644 --- a/core/lib/Drupal/Core/Entity/EntityControllerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityControllerInterface.php @@ -38,6 +38,6 @@ * @return static * A new instance of the entity controller. */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info); + public static function create(ContainerInterface $container, $entity_type, array $entity_info); } diff --git a/core/lib/Drupal/Core/Entity/EntityListController.php b/core/lib/Drupal/Core/Entity/EntityListController.php index 09cc203..3fc5ea8 100644 --- a/core/lib/Drupal/Core/Entity/EntityListController.php +++ b/core/lib/Drupal/Core/Entity/EntityListController.php @@ -49,7 +49,7 @@ class EntityListController implements EntityListControllerInterface, EntityContr /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index a662259..8b11eda 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -206,7 +206,7 @@ public function getListController($entity_type) { if (!isset($this->controllers['listing'][$entity_type])) { $class = $this->getControllerClass($entity_type, 'list'); if (in_array('Drupal\Core\Entity\EntityControllerInterface', class_implements($class))) { - $this->controllers['listing'][$entity_type] = $class::createInstance($this->container, $entity_type, $this->getDefinition($entity_type)); + $this->controllers['listing'][$entity_type] = $class::create($this->container, $entity_type, $this->getDefinition($entity_type)); } else { $this->controllers['listing'][$entity_type] = new $class($entity_type, $this->getStorageController($entity_type)); @@ -230,7 +230,7 @@ public function getFormController($entity_type, $operation) { if (!isset($this->controllers['form'][$operation][$entity_type])) { $class = $this->getControllerClass($entity_type, 'form', $operation); if (in_array('Drupal\Core\Entity\EntityControllerInterface', class_implements($class))) { - $this->controllers['form'][$operation][$entity_type] = $class::createInstance($this->container, $entity_type, $this->getDefinition($entity_type)); + $this->controllers['form'][$operation][$entity_type] = $class::create($this->container, $entity_type, $this->getDefinition($entity_type)); } else { $this->controllers['form'][$operation][$entity_type] = new $class($this->container->get('module_handler')); @@ -281,7 +281,7 @@ protected function getController($entity_type, $controller_type) { if (!isset($this->controllers[$controller_type][$entity_type])) { $class = $this->getControllerClass($entity_type, $controller_type); if (in_array('Drupal\Core\Entity\EntityControllerInterface', class_implements($class))) { - $this->controllers[$controller_type][$entity_type] = $class::createInstance($this->container, $entity_type, $this->getDefinition($entity_type)); + $this->controllers[$controller_type][$entity_type] = $class::create($this->container, $entity_type, $this->getDefinition($entity_type)); } else { $this->controllers[$controller_type][$entity_type] = new $class($entity_type); diff --git a/core/lib/Drupal/Core/Entity/EntityNG.php b/core/lib/Drupal/Core/Entity/EntityNG.php index ac975d1..8ab78e4 100644 --- a/core/lib/Drupal/Core/Entity/EntityNG.php +++ b/core/lib/Drupal/Core/Entity/EntityNG.php @@ -589,7 +589,7 @@ public function addTranslation($langcode, array $values = array()) { $default_values = array($info['entity_keys']['bundle'] => $this->bundle, 'langcode' => $langcode); $entity = \Drupal::entityManager() ->getStorageController($this->entityType()) - ->create($default_values); + ->createEntity($default_values); foreach ($entity as $name => $field) { if (!isset($values[$name]) && !$field->isEmpty()) { diff --git a/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php b/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php index 24447fd..0511a68 100644 --- a/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php @@ -108,7 +108,7 @@ public function loadByProperties(array $values = array()); * @return \Drupal\Core\Entity\EntityInterface * A new entity object. */ - public function create(array $values); + public function createEntity(array $values); /** * Deletes permanently saved entities. diff --git a/core/lib/Drupal/Core/Entity/HtmlEntityFormController.php b/core/lib/Drupal/Core/Entity/HtmlEntityFormController.php index 8f62a40..e203190 100644 --- a/core/lib/Drupal/Core/Entity/HtmlEntityFormController.php +++ b/core/lib/Drupal/Core/Entity/HtmlEntityFormController.php @@ -56,7 +56,7 @@ protected function getFormObject(Request $request, $form_arg) { $entity = $request->attributes->get($entity_type); } else { - $entity = $manager->getStorageController($entity_type)->create(array()); + $entity = $manager->getStorageController($entity_type)->createEntity(array()); } return $manager->getFormController($entity_type, $operation)->setEntity($entity); diff --git a/core/modules/action/lib/Drupal/action/ActionAddFormController.php b/core/modules/action/lib/Drupal/action/ActionAddFormController.php index 56d7bbf..2b42a06 100644 --- a/core/modules/action/lib/Drupal/action/ActionAddFormController.php +++ b/core/modules/action/lib/Drupal/action/ActionAddFormController.php @@ -45,7 +45,7 @@ public function __construct(ModuleHandlerInterface $module_handler, EntityStorag /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('plugin.manager.entity')->getStorageController($entity_type), diff --git a/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php b/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php index e9df397..43db362 100644 --- a/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php +++ b/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php @@ -50,7 +50,7 @@ public function __construct(ModuleHandlerInterface $module_handler, EntityStorag /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('plugin.manager.entity')->getStorageController($entity_type) diff --git a/core/modules/action/lib/Drupal/action/ActionListController.php b/core/modules/action/lib/Drupal/action/ActionListController.php index f3d5848..d030d10 100644 --- a/core/modules/action/lib/Drupal/action/ActionListController.php +++ b/core/modules/action/lib/Drupal/action/ActionListController.php @@ -57,7 +57,7 @@ public function __construct($entity_type, array $entity_info, EntityStorageContr /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php b/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php index a8b1d80..a476761 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php @@ -103,7 +103,7 @@ public static function create(ContainerInterface $container) { public function feedAdd() { $feed = $this->entityManager ->getStorageController('aggregator_feed') - ->create(array( + ->createEntity(array( 'refresh' => 3600, 'block' => 5, )); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php b/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php index 0959fb0..f66bf89 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php @@ -216,7 +216,7 @@ public function submitForm(array &$form, array &$form_state) { $new_feed = $this->entityManager ->getStorageController('aggregator_feed') - ->create(array( + ->createEntity(array( 'title' => $feed['title'], 'url' => $feed['url'], 'refresh' => $form_state['values']['refresh'], diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php index da85242..5f3ae46 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php @@ -77,7 +77,7 @@ public function testAggregatorItemView() { $values['author'] = $this->randomName() . '"'; $values['link'] = 'http://drupal.org/node/' . mt_rand(1000, 10000); - $aggregator_item = $this->itemStorageController->create($values); + $aggregator_item = $this->itemStorageController->createEntity($values); $aggregator_item->save(); $items[$aggregator_item->id()] = $aggregator_item; diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php index 03edb7f..3acb870 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php @@ -102,7 +102,7 @@ public function addForm(CustomBlockTypeInterface $custom_block_type, Request $re drupal_set_title(t('Add %type custom block', array( '%type' => $custom_block_type->label() )), PASS_THROUGH); - $block = $this->customBlockStorage->create(array( + $block = $this->customBlockStorage->createEntity(array( 'type' => $custom_block_type->id() )); if (($theme = $request->attributes->get('theme')) && in_array($theme, array_keys(list_themes()))) { diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php index 4b7c220..6a5b4f8 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php @@ -42,7 +42,7 @@ public function __construct(ModuleHandlerInterface $module_handler, QueryFactory /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('entity.query') diff --git a/core/modules/block/lib/Drupal/block/BlockFormController.php b/core/modules/block/lib/Drupal/block/BlockFormController.php index 6041b2c..687603b 100644 --- a/core/modules/block/lib/Drupal/block/BlockFormController.php +++ b/core/modules/block/lib/Drupal/block/BlockFormController.php @@ -54,7 +54,7 @@ public function __construct(ModuleHandlerInterface $module_handler, EntityManage /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('plugin.manager.entity'), diff --git a/core/modules/block/lib/Drupal/block/BlockListController.php b/core/modules/block/lib/Drupal/block/BlockListController.php index b222fb6..8ddeb27 100644 --- a/core/modules/block/lib/Drupal/block/BlockListController.php +++ b/core/modules/block/lib/Drupal/block/BlockListController.php @@ -66,7 +66,7 @@ public function __construct($entity_type, array $entity_info, EntityStorageContr /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/modules/block/lib/Drupal/block/Controller/BlockAddController.php b/core/modules/block/lib/Drupal/block/Controller/BlockAddController.php index 0d065eb..db53876 100644 --- a/core/modules/block/lib/Drupal/block/Controller/BlockAddController.php +++ b/core/modules/block/lib/Drupal/block/Controller/BlockAddController.php @@ -31,7 +31,7 @@ public function blockAddConfigureForm($plugin_id, $theme) { drupal_set_title(t('Configure block')); // Create a block entity. - $entity = $this->entityManager()->getStorageController('block')->create(array('plugin' => $plugin_id, 'theme' => $theme)); + $entity = $this->entityManager()->getStorageController('block')->createEntity(array('plugin' => $plugin_id, 'theme' => $theme)); return $this->entityManager()->getForm($entity); } diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php index d787a3d..d12aed4 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php @@ -70,7 +70,7 @@ public function testBlockCRUD() { protected function createTests() { // Attempt to create a block without a plugin. try { - $entity = $this->controller->create(array()); + $entity = $this->controller->createEntity(array()); $entity->getPlugin(); $this->fail('A block without a plugin was created with no exception thrown.'); } @@ -79,7 +79,7 @@ protected function createTests() { } // Create a block with only required values. - $entity = $this->controller->create(array( + $entity = $this->controller->createEntity(array( 'id' => 'stark.test_block', 'plugin' => 'test_html_id', )); @@ -152,7 +152,7 @@ protected function renderTests() { drupal_static_reset('drupal_html_id'); // Test the rendering of a block with a given title. - $entity = $this->controller->create(array( + $entity = $this->controller->createEntity(array( 'id' => 'stark.test_block2', 'plugin' => 'test_html_id', 'settings' => array( diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php index 88a0d7c..cd4f109 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php @@ -40,7 +40,7 @@ function setUp() { // Add the basic_html filter format from the standard install profile. $filter_format_storage_controller = $this->container->get('plugin.manager.entity')->getStorageController('filter_format'); - $filter_format = $filter_format_storage_controller->create(array( + $filter_format = $filter_format_storage_controller->createEntity(array( 'format' => 'basic_html', 'name' => 'Basic HTML', 'status' => '1', diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php index f97d6cf..6b204c9 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php @@ -100,19 +100,19 @@ function testList() { $this->assertIdentical($expected_items, $actual_items, 'Return value from buildRow matches expected.'); // Test sorting. $storage_controller = $controller->getStorageController(); - $entity = $storage_controller->create(array( + $entity = $storage_controller->createEntity(array( 'id' => 'alpha', 'label' => 'Alpha', 'weight' => 1, )); $entity->save(); - $entity = $storage_controller->create(array( + $entity = $storage_controller->createEntity(array( 'id' => 'omega', 'label' => 'Omega', 'weight' => 1, )); $entity->save(); - $entity = $storage_controller->create(array( + $entity = $storage_controller->createEntity(array( 'id' => 'beta', 'label' => 'Beta', 'weight' => 0, diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php index 8be1055..3f23625 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php @@ -47,14 +47,14 @@ public function testStorageControllerMethods() { // Create three entities, two with the same style. $style = $this->randomName(8); for ($i = 0; $i < 2; $i++) { - $entity = $controller->create(array( + $entity = $controller->createEntity(array( 'id' => $this->randomName(), 'label' => $this->randomString(), 'style' => $style, )); $entity->save(); } - $entity = $controller->create(array( + $entity = $controller->createEntity(array( 'id' => $this->randomName(), 'label' => $this->randomString(), // Use a different length for the entity to ensure uniqueness. diff --git a/core/modules/contact/lib/Drupal/contact/Tests/MessageEntityTest.php b/core/modules/contact/lib/Drupal/contact/Tests/MessageEntityTest.php index c9e2e5d..8835867 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/MessageEntityTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/MessageEntityTest.php @@ -41,7 +41,7 @@ protected function setUp() { */ public function testMessageMethods() { $message_storage = $this->container->get('plugin.manager.entity')->getStorageController('contact_message'); - $message = $message_storage->create(array('category' => 'feedback')); + $message = $message_storage->createEntity(array('category' => 'feedback')); // Check for empty values first. $this->assertEqual($message->getMessage(), ''); diff --git a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php index b0f8f6e..56a83cb 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php +++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListController.php @@ -49,7 +49,7 @@ public function __construct($entity_type, array $entity_info, EntityStorageContr /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { $entity_manager = $container->get('plugin.manager.entity'); return new static( $entity_type, diff --git a/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php b/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php index ad67f5a..6688b0f 100644 --- a/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php +++ b/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php @@ -51,7 +51,7 @@ public function __construct(ModuleHandlerInterface $module_handler, QueryFactory /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('entity.query'), diff --git a/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeFormBase.php b/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeFormBase.php index 787432a..84ffa48 100644 --- a/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeFormBase.php +++ b/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeFormBase.php @@ -52,7 +52,7 @@ public function __construct(ModuleHandlerInterface $module_handler, QueryFactory /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('entity.query'), diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php index 3587046..6d7e7bd 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php @@ -172,7 +172,7 @@ protected function createNewEntity($label, $uid) { $bundle_key = $entity_info['entity_keys']['bundle']; $label_key = $entity_info['entity_keys']['label']; - return $entity_manager->getStorageController($target_type)->create(array( + return $entity_manager->getStorageController($target_type)->createEntity(array( $label_key => $label, $bundle_key => $bundle, 'uid' => $uid, diff --git a/core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php b/core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php index f9ce249..5d89b54 100644 --- a/core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php +++ b/core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php @@ -76,7 +76,7 @@ public function __construct($entity_type, array $entity_info, ConfigFactory $con /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, @@ -129,7 +129,7 @@ public function loadByProperties(array $conditions = array()) { if ($include_deleted) { $deleted_instances = $this->state->get('field.instance.deleted') ?: array(); foreach ($deleted_instances as $id => $config) { - $instances[$id] = $this->entityManager->getStorageController($this->entityType)->create($config); + $instances[$id] = $this->entityManager->getStorageController($this->entityType)->createEntity($config); } } diff --git a/core/modules/field/lib/Drupal/field/FieldStorageController.php b/core/modules/field/lib/Drupal/field/FieldStorageController.php index 41efe60..403b09a 100644 --- a/core/modules/field/lib/Drupal/field/FieldStorageController.php +++ b/core/modules/field/lib/Drupal/field/FieldStorageController.php @@ -72,7 +72,7 @@ public function __construct($entity_type, array $entity_info, ConfigFactory $con /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, @@ -111,7 +111,7 @@ public function loadByProperties(array $conditions = array()) { if ($include_deleted) { $deleted_fields = $this->state->get('field.field.deleted') ?: array(); foreach ($deleted_fields as $id => $config) { - $fields[$id] = $this->entityManager->getStorageController($this->entityType)->create($config); + $fields[$id] = $this->entityManager->getStorageController($this->entityType)->createEntity($config); } } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldListController.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldListController.php index 514e966..2e041dc 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldListController.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldListController.php @@ -84,7 +84,7 @@ public function __construct($entity_type, array $entity_info, EntityManager $ent /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php index d2208a1..3e4fb04 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php @@ -395,8 +395,8 @@ public function submitForm(array &$form, array &$form_state) { // Create the field and instance. try { - $this->entityManager->getStorageController('field_entity')->create($field)->save(); - $new_instance = $this->entityManager->getStorageController('field_instance')->create($instance); + $this->entityManager->getStorageController('field_entity')->createEntity($field)->save(); + $new_instance = $this->entityManager->getStorageController('field_instance')->createEntity($instance); $new_instance->save(); // Make sure the field is displayed in the 'default' form mode (using @@ -442,7 +442,7 @@ public function submitForm(array &$form, array &$form_state) { ); try { - $new_instance = $this->entityManager->getStorageController('field_instance')->create($instance); + $new_instance = $this->entityManager->getStorageController('field_instance')->createEntity($instance); $new_instance->save(); // Make sure the field is displayed in the 'default' form mode (using diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldDeleteForm.php b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldDeleteForm.php index e53eec9..cef3173 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldDeleteForm.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldDeleteForm.php @@ -41,7 +41,7 @@ public function __construct(ModuleHandlerInterface $module_handler, EntityManage /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('plugin.manager.entity') diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php index e715e4a..bbb2f3c 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php @@ -53,7 +53,7 @@ public function __construct(ModuleHandlerInterface $module_handler, ConfigFactor /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('config.factory'), diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php b/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php index c8df5e6..9da1ab8 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php @@ -51,7 +51,7 @@ public function __construct($entity_type, array $entity_info, EntityStorageContr /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php b/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php index 51747fd..7a10311 100644 --- a/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php +++ b/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php @@ -74,7 +74,7 @@ public function __construct(EntityManager $entity_manager, ConfigFactory $config */ public function addForum() { $vid = $this->config->get('vocabulary'); - $taxonomy_term = $this->storageController->create(array( + $taxonomy_term = $this->storageController->createEntity(array( 'vid' => $vid, )); return $this->entityManager->getForm($taxonomy_term, 'forum'); @@ -88,7 +88,7 @@ public function addForum() { */ public function addContainer() { $vid = $this->config->get('vocabulary'); - $taxonomy_term = $this->storageController->create(array( + $taxonomy_term = $this->storageController->createEntity(array( 'vid' => $vid, )); return $this->entityManager->getForm($taxonomy_term, 'container'); diff --git a/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php b/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php index b517747..2722f6c 100644 --- a/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php +++ b/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php @@ -78,7 +78,7 @@ public function __construct(ModuleHandlerInterface $module_handler, ConfigFactor /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('config.factory'), diff --git a/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php b/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php index cfcdfa2..6d9285a 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php @@ -50,7 +50,7 @@ protected function setUp() { public function testForumIntegration() { // Create a forum. $entity_manager = $this->container->get('plugin.manager.entity'); - $term = $entity_manager->getStorageController('taxonomy_term')->create(array('vid' => 'forums')); + $term = $entity_manager->getStorageController('taxonomy_term')->createEntity(array('vid' => 'forums')); $term->save(); $comment_storage_controller = $entity_manager->getStorageController('comment'); @@ -65,7 +65,7 @@ public function testForumIntegration() { $comments = array(); foreach ($nodes as $index => $node) { for ($i = 0; $i <= $index; $i++) { - $comment = $comment_storage_controller->create(array('node_type' => 'node_type_forum', 'nid' => $node->id())); + $comment = $comment_storage_controller->createEntity(array('node_type' => 'node_type_forum', 'nid' => $node->id())); $comment->save(); $comments[$comment->get('nid')->target_id][$comment->id()] = $comment; } diff --git a/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php b/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php index 0625cdd..e4b3950 100644 --- a/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php +++ b/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php @@ -48,7 +48,7 @@ public function __construct(ModuleHandlerInterface $module_handler, EntityStorag /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('plugin.manager.entity')->getStorageController($entity_type), diff --git a/core/modules/image/lib/Drupal/image/Form/ImageStyleFormBase.php b/core/modules/image/lib/Drupal/image/Form/ImageStyleFormBase.php index a050434..279bd60 100644 --- a/core/modules/image/lib/Drupal/image/Form/ImageStyleFormBase.php +++ b/core/modules/image/lib/Drupal/image/Form/ImageStyleFormBase.php @@ -52,7 +52,7 @@ public function __construct(ModuleHandlerInterface $module_handler, EntityStorag /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('plugin.manager.entity')->getStorageController($entity_type), diff --git a/core/modules/image/lib/Drupal/image/ImageStyleListController.php b/core/modules/image/lib/Drupal/image/ImageStyleListController.php index c4b7e64..70acb7a 100644 --- a/core/modules/image/lib/Drupal/image/ImageStyleListController.php +++ b/core/modules/image/lib/Drupal/image/ImageStyleListController.php @@ -60,7 +60,7 @@ public function __construct($entity_type, array $entity_info, EntityStorageContr /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php b/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php index f707dfb..548fd42 100644 --- a/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php +++ b/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php @@ -90,7 +90,7 @@ public function getParentOptions(Request $request) { public function addLink(MenuInterface $menu) { // @todo Remove this when https://drupal.org/node/1981644 is in. drupal_set_title(t('Add menu link')); - $menu_link = $this->menuLinkStorage->create(array( + $menu_link = $this->menuLinkStorage->createEntity(array( 'mlid' => 0, 'plid' => 0, 'menu_name' => $menu->id(), diff --git a/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php b/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php index febf8b9..8570995 100644 --- a/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php +++ b/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php @@ -52,7 +52,7 @@ public function __construct(ModuleHandlerInterface $module_handler, EntityStorag /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('plugin.manager.entity')->getStorageController('menu_link'), diff --git a/core/modules/menu/lib/Drupal/menu/MenuFormController.php b/core/modules/menu/lib/Drupal/menu/MenuFormController.php index 6573865..22b7556 100644 --- a/core/modules/menu/lib/Drupal/menu/MenuFormController.php +++ b/core/modules/menu/lib/Drupal/menu/MenuFormController.php @@ -62,7 +62,7 @@ public function __construct(ModuleHandlerInterface $module_handler, QueryFactory /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('entity.query'), diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php index 9d58de9..e7c8855 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php @@ -60,7 +60,7 @@ public function __construct(ModuleHandlerInterface $module_handler, MenuLinkStor /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info, $operation = NULL) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info, $operation = NULL) { return new static( $container->get('module_handler'), $container->get('plugin.manager.entity')->getStorageController('menu_link'), diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php index 43d54ce..ed80b3d 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php @@ -68,19 +68,19 @@ public function __construct($entity_type, array $entity_info, Connection $databa /** * {@inheritdoc} */ - public function create(array $values) { + public function createEntity(array $values) { // The bundle of menu links being the menu name is not enforced but is the // default behavior if no bundle is set. if (!isset($values['bundle']) && isset($values['menu_name'])) { $values['bundle'] = $values['menu_name']; } - return parent::create($values); + return parent::createEntity($values); } /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php b/core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php index 3ff0fdf..dd7bdd4 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php @@ -348,7 +348,7 @@ public static function buildFromRouterItem(array $item) { 'options' => empty($item['description']) ? array() : array('attributes' => array('title' => $item['description'])), ); return \Drupal::entityManager() - ->getStorageController('menu_link')->create($item); + ->getStorageController('menu_link')->createEntity($item); } /** diff --git a/core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php b/core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php index 5a3fdb0..e60687e 100644 --- a/core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php +++ b/core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php @@ -54,7 +54,7 @@ public function __construct(ModuleHandlerInterface $module_handler, PathBasedGen /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('url_generator'), diff --git a/core/modules/node/lib/Drupal/node/Form/NodeTypeDeleteConfirm.php b/core/modules/node/lib/Drupal/node/Form/NodeTypeDeleteConfirm.php index d159b3d..0179867 100644 --- a/core/modules/node/lib/Drupal/node/Form/NodeTypeDeleteConfirm.php +++ b/core/modules/node/lib/Drupal/node/Form/NodeTypeDeleteConfirm.php @@ -42,7 +42,7 @@ public function __construct(ModuleHandlerInterface $module_handler, Connection $ /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('database') diff --git a/core/modules/node/lib/Drupal/node/NodeAccessController.php b/core/modules/node/lib/Drupal/node/NodeAccessController.php index 2556d76..59812ef 100644 --- a/core/modules/node/lib/Drupal/node/NodeAccessController.php +++ b/core/modules/node/lib/Drupal/node/NodeAccessController.php @@ -57,7 +57,7 @@ public function __construct($entity_type, NodeGrantDatabaseStorageInterface $gra /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $container->get('node.grant_storage'), diff --git a/core/modules/node/lib/Drupal/node/NodeStorageController.php b/core/modules/node/lib/Drupal/node/NodeStorageController.php index 1a874fe..35559b6 100644 --- a/core/modules/node/lib/Drupal/node/NodeStorageController.php +++ b/core/modules/node/lib/Drupal/node/NodeStorageController.php @@ -19,14 +19,14 @@ class NodeStorageController extends DatabaseStorageControllerNG { /** - * Overrides Drupal\Core\Entity\DatabaseStorageController::create(). + * Overrides Drupal\Core\Entity\DatabaseStorageController::createEntity(). */ - public function create(array $values) { + public function createEntity(array $values) { // @todo Handle this through property defaults. if (empty($values['created'])) { $values['created'] = REQUEST_TIME; } - return parent::create($values)->getBCEntity(); + return parent::createEntity($values)->getBCEntity(); } /** diff --git a/core/modules/node/lib/Drupal/node/NodeTypeListController.php b/core/modules/node/lib/Drupal/node/NodeTypeListController.php index d6be67d..113f80c 100644 --- a/core/modules/node/lib/Drupal/node/NodeTypeListController.php +++ b/core/modules/node/lib/Drupal/node/NodeTypeListController.php @@ -49,7 +49,7 @@ public function __construct($entity_type, array $entity_info, EntityStorageContr /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/modules/node/lib/Drupal/node/Tests/Views/FrontpageTest.php b/core/modules/node/lib/Drupal/node/Tests/Views/FrontpageTest.php index f638dbe..43c8aa9 100644 --- a/core/modules/node/lib/Drupal/node/Tests/Views/FrontpageTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/Views/FrontpageTest.php @@ -75,14 +75,14 @@ public function testFrontPage() { // Test the sticky order. if ($i == 5) { $values['sticky'] = TRUE; - $node = $this->nodeStorageController->create($values); + $node = $this->nodeStorageController->createEntity($values); $node->save(); // Put the sticky on at the front. array_unshift($expected, array('nid' => $node->id())); } else { $values['sticky'] = FALSE; - $node = $this->nodeStorageController->create($values); + $node = $this->nodeStorageController->createEntity($values); $node->save(); array_push($expected, array('nid' => $node->id())); } @@ -97,14 +97,14 @@ public function testFrontPage() { $values['title'] = $this->randomName(); $values['status'] = TRUE; $values['promote'] = FALSE; - $node = $this->nodeStorageController->create($values); + $node = $this->nodeStorageController->createEntity($values); $node->save(); $not_expected_nids[] = $node->id(); $values['promote'] = TRUE; $values['status'] = FALSE; $values['title'] = $this->randomName(); - $node = $this->nodeStorageController->create($values); + $node = $this->nodeStorageController->createEntity($values); $node->save(); $not_expected_nids[] = $node->id(); @@ -112,7 +112,7 @@ public function testFrontPage() { $values['sticky'] = TRUE; $values['status'] = FALSE; $values['title'] = $this->randomName(); - $node = $this->nodeStorageController->create($values); + $node = $this->nodeStorageController->createEntity($values); $node->save(); $not_expected_nids[] = $node->id(); diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutSetDeleteForm.php b/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutSetDeleteForm.php index a12dbd8..ffaebff 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutSetDeleteForm.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutSetDeleteForm.php @@ -46,7 +46,7 @@ public function __construct(ModuleHandlerInterface $module_handler, Connection $ /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('database'), diff --git a/core/modules/system/lib/Drupal/system/DateFormatListController.php b/core/modules/system/lib/Drupal/system/DateFormatListController.php index e08c825..80f4e37 100644 --- a/core/modules/system/lib/Drupal/system/DateFormatListController.php +++ b/core/modules/system/lib/Drupal/system/DateFormatListController.php @@ -50,7 +50,7 @@ public function __construct($entity_type, array $entity_info, EntityStorageContr /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/modules/system/lib/Drupal/system/Form/DateFormatDeleteForm.php b/core/modules/system/lib/Drupal/system/Form/DateFormatDeleteForm.php index 3d3dfc7..8544bf3 100644 --- a/core/modules/system/lib/Drupal/system/Form/DateFormatDeleteForm.php +++ b/core/modules/system/lib/Drupal/system/Form/DateFormatDeleteForm.php @@ -43,7 +43,7 @@ public function __construct(ModuleHandlerInterface $module_handler, Date $date_s /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('date') diff --git a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php index d6aac67..3e76857 100644 --- a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php +++ b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php @@ -66,7 +66,7 @@ function __construct(ModuleHandlerInterface $module_handler, QueryFactory $query /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('entity.query'), diff --git a/core/modules/system/lib/Drupal/system/Tests/Action/ActionUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Action/ActionUnitTest.php index 87e5113..e4692f0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Action/ActionUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Action/ActionUnitTest.php @@ -71,7 +71,7 @@ public function testOperations() { // Create a new unsaved user. $name = $this->randomName(); $user_storage = $this->container->get('plugin.manager.entity')->getStorageController('user'); - $account = $user_storage->create(array('name' => $name, 'bundle' => 'user')); + $account = $user_storage->createEntity(array('name' => $name, 'bundle' => 'user')); $loaded_accounts = $user_storage->loadMultiple(); $this->assertEqual(count($loaded_accounts), 0); diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryAggregateTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryAggregateTest.php index faa7090..b15ef89 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryAggregateTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryAggregateTest.php @@ -73,7 +73,7 @@ public function setUp() { ))->save(); } - $entity = $this->entityStorageController->create(array( + $entity = $this->entityStorageController->createEntity(array( 'id' => 1, 'user_id' => 1, 'field_test_1' => 1, @@ -82,7 +82,7 @@ public function setUp() { $entity->enforceIsNew(); $entity->save(); - $entity = $this->entityStorageController->create(array( + $entity = $this->entityStorageController->createEntity(array( 'id' => 2, 'user_id' => 2, 'field_test_1' => 1, @@ -90,7 +90,7 @@ public function setUp() { )); $entity->enforceIsNew(); $entity->save(); - $entity = $this->entityStorageController->create(array( + $entity = $this->entityStorageController->createEntity(array( 'id' => 3, 'user_id' => 2, 'field_test_1' => 2, @@ -98,7 +98,7 @@ public function setUp() { )); $entity->enforceIsNew(); $entity->save(); - $entity = $this->entityStorageController->create(array( + $entity = $this->entityStorageController->createEntity(array( 'id' => 4, 'user_id' => 2, 'field_test_1' => 2, @@ -106,7 +106,7 @@ public function setUp() { )); $entity->enforceIsNew(); $entity->save(); - $entity = $this->entityStorageController->create(array( + $entity = $this->entityStorageController->createEntity(array( 'id' => 5, 'user_id' => 3, 'field_test_1' => 2, @@ -114,7 +114,7 @@ public function setUp() { )); $entity->enforceIsNew(); $entity->save(); - $entity = $this->entityStorageController->create(array( + $entity = $this->entityStorageController->createEntity(array( 'id' => 6, 'user_id' => 3, 'field_test_1' => 3, diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php index 40a7e44..2b8b453 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php @@ -330,7 +330,7 @@ function testEntityTranslationAPI() { $langcode = $this->langcodes[1]; $entity = $this->entityManager ->getStorageController('entity_test_mul') - ->create(array('name' => $this->randomName())); + ->createEntity(array('name' => $this->randomName())); $entity->save(); $hooks = $this->getHooksInfo(); diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php index 502a206..39bfe5d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php @@ -43,7 +43,7 @@ function setUp() { for ($i = 0; $i < 2; $i++) { $random_label = $this->randomName(); $data = array('bundle' => 'entity_test_render', 'name' => $random_label); - $entity_test = $this->container->get('plugin.manager.entity')->getStorageController('entity_test_render')->create($data); + $entity_test = $this->container->get('plugin.manager.entity')->getStorageController('entity_test_render')->createEntity($data); $entity_test->save(); $this->entities[] = $entity_test; } diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/TreeOutputTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/TreeOutputTest.php index 01794f0..199e2c2 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/TreeOutputTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/TreeOutputTest.php @@ -43,21 +43,21 @@ function testMenuTreeData() { // @todo Prettify this tree buildup code, it's very hard to read. $this->tree_data = array( '1'=> array( - 'link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 1, 'hidden' => 0, 'has_children' => 1, 'title' => 'Item 1', 'in_active_trail' => 1, 'access' => 1, 'href' => 'a', 'localized_options' => array('attributes' => array('title' =>'')))), + 'link' => $storage_controller->createEntity(array('menu_name' => 'main-menu', 'mlid' => 1, 'hidden' => 0, 'has_children' => 1, 'title' => 'Item 1', 'in_active_trail' => 1, 'access' => 1, 'href' => 'a', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array( - '2' => array('link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 2, 'hidden' => 0, 'has_children' => 1, 'title' => 'Item 2', 'in_active_trail' => 1, 'access' => 1, 'href' => 'a/b', 'localized_options' => array('attributes' => array('title' =>'')))), + '2' => array('link' => $storage_controller->createEntity(array('menu_name' => 'main-menu', 'mlid' => 2, 'hidden' => 0, 'has_children' => 1, 'title' => 'Item 2', 'in_active_trail' => 1, 'access' => 1, 'href' => 'a/b', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array( - '3' => array('link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 3, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 3', 'in_active_trail' => 0, 'access' => 1, 'href' => 'a/b/c', 'localized_options' => array('attributes' => array('title' =>'')))), + '3' => array('link' => $storage_controller->createEntity(array('menu_name' => 'main-menu', 'mlid' => 3, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 3', 'in_active_trail' => 0, 'access' => 1, 'href' => 'a/b/c', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array() ), - '4' => array('link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 4, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 4', 'in_active_trail' => 0, 'access' => 1, 'href' => 'a/b/d', 'localized_options' => array('attributes' => array('title' =>'')))), + '4' => array('link' => $storage_controller->createEntity(array('menu_name' => 'main-menu', 'mlid' => 4, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 4', 'in_active_trail' => 0, 'access' => 1, 'href' => 'a/b/d', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array() ) ) ) ) ), - '5' => array('link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 5, 'hidden' => 1, 'has_children' => 0, 'title' => 'Item 5', 'in_active_trail' => 0, 'access' => 1, 'href' => 'e', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array()), - '6' => array('link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 6, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 6', 'in_active_trail' => 0, 'access' => 0, 'href' => 'f', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array()), - '7' => array('link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 7, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 7', 'in_active_trail' => 0, 'access' => 1, 'href' => 'g', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array()) + '5' => array('link' => $storage_controller->createEntity(array('menu_name' => 'main-menu', 'mlid' => 5, 'hidden' => 1, 'has_children' => 0, 'title' => 'Item 5', 'in_active_trail' => 0, 'access' => 1, 'href' => 'e', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array()), + '6' => array('link' => $storage_controller->createEntity(array('menu_name' => 'main-menu', 'mlid' => 6, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 6', 'in_active_trail' => 0, 'access' => 0, 'href' => 'f', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array()), + '7' => array('link' => $storage_controller->createEntity(array('menu_name' => 'main-menu', 'mlid' => 7, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 7', 'in_active_trail' => 0, 'access' => 1, 'href' => 'g', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array()) ); $output = menu_tree_output($this->tree_data); diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestStorageController.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestStorageController.php index be93b68..614ec19 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestStorageController.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestStorageController.php @@ -20,11 +20,11 @@ class EntityTestStorageController extends DatabaseStorageControllerNG { /** * {@inheritdoc} */ - public function create(array $values) { + public function createEntity(array $values) { if (empty($values['type'])) { $values['type'] = $this->entityType; } - return parent::create($values); + return parent::createEntity($values); } /** diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php index 938cc7b..6aee4f2 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php @@ -26,7 +26,7 @@ class TaxonomyController extends ControllerBase { * The taxonomy term add form. */ public function addForm(VocabularyInterface $taxonomy_vocabulary) { - $term = $this->entityManager()->getStorageController('taxonomy_term')->create(array('vid' => $taxonomy_vocabulary->id())); + $term = $this->entityManager()->getStorageController('taxonomy_term')->createEntity(array('vid' => $taxonomy_vocabulary->id())); if ($this->moduleHandler()->moduleExists('language')) { $term->langcode = language_get_default_langcode('taxonomy_term', $taxonomy_vocabulary->id()); } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/TermDeleteForm.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/TermDeleteForm.php index fe8dffb..648356b 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/TermDeleteForm.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/TermDeleteForm.php @@ -40,7 +40,7 @@ public function __construct(ModuleHandlerInterface $module_handler, VocabularySt /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('plugin.manager.entity')->getStorageController('taxonomy_vocabulary') diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/VocabularyResetForm.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/VocabularyResetForm.php index 4366cb2..d0bfabd 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/VocabularyResetForm.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/VocabularyResetForm.php @@ -38,7 +38,7 @@ public function __construct(ModuleHandlerInterface $module_handler, Connection $ /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('database') diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageController.php index cb0821c..3950c68 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageController.php @@ -17,18 +17,18 @@ class TermStorageController extends DatabaseStorageControllerNG implements TermStorageControllerInterface { /** - * Overrides Drupal\Core\Entity\DatabaseStorageController::create(). + * Overrides Drupal\Core\Entity\DatabaseStorageController::createEntity(). * * @param array $values * An array of values to set, keyed by property name. A value for the * vocabulary ID ('vid') is required. */ - public function create(array $values) { + public function createEntity(array $values) { // Save new terms with no parents by default. if (empty($values['parent'])) { $values['parent'] = array(0); } - $entity = parent::create($values); + $entity = parent::createEntity($values); return $entity; } diff --git a/core/modules/user/lib/Drupal/user/Tests/UserEntityTest.php b/core/modules/user/lib/Drupal/user/Tests/UserEntityTest.php index 14d885c..dc10fbe 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserEntityTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserEntityTest.php @@ -42,9 +42,9 @@ public static function getInfo() { */ public function testUserMethods() { $role_storage = $this->container->get('plugin.manager.entity')->getStorageController('user_role'); - $role_storage->create(array('id' => 'test_role_one'))->save(); - $role_storage->create(array('id' => 'test_role_two'))->save(); - $role_storage->create(array('id' => 'test_role_three'))->save(); + $role_storage->createEntity(array('id' => 'test_role_one'))->save(); + $role_storage->createEntity(array('id' => 'test_role_two'))->save(); + $role_storage->createEntity(array('id' => 'test_role_three'))->save(); $values = array('roles' => array(Language::LANGCODE_DEFAULT => array('test_role_one'))); $user = new User($values, 'user'); diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php b/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php index 9350338..4da1a92 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php @@ -61,33 +61,33 @@ protected function setUp() { */ protected function setupPermissionTestData() { // Setup a role without any permission. - $this->roleStorageController->create(array('id' => 'authenticated')) + $this->roleStorageController->createEntity(array('id' => 'authenticated')) ->save(); - $this->roleStorageController->create(array('id' => 'no_permission')) + $this->roleStorageController->createEntity(array('id' => 'no_permission')) ->save(); // Setup a role with just one permission. - $this->roleStorageController->create(array('id' => 'one_permission')) + $this->roleStorageController->createEntity(array('id' => 'one_permission')) ->save(); user_role_grant_permissions('one_permission', array('administer permissions')); // Setup a role with multiple permissions. - $this->roleStorageController->create(array('id' => 'multiple_permissions')) + $this->roleStorageController->createEntity(array('id' => 'multiple_permissions')) ->save(); user_role_grant_permissions('multiple_permissions', array('administer permissions', 'administer users', 'access user profiles')); // Setup a user without an extra role. - $this->users[] = $account = $this->userStorageController->create(array()); + $this->users[] = $account = $this->userStorageController->createEntity(array()); $account->save(); // Setup a user with just the first role (so no permission beside the // ones from the authenticated role). - $this->users[] = $account = $this->userStorageController->create(array('name' => 'first_role')); + $this->users[] = $account = $this->userStorageController->createEntity(array('name' => 'first_role')); $account->addRole('no_permission'); $account->save(); // Setup a user with just the second role (so one additional permission). - $this->users[] = $account = $this->userStorageController->create(array('name' => 'second_role')); + $this->users[] = $account = $this->userStorageController->createEntity(array('name' => 'second_role')); $account->addRole('one_permission'); $account->save(); // Setup a user with both the second and the third role. - $this->users[] = $account = $this->userStorageController->create(array('name' => 'second_third_role')); + $this->users[] = $account = $this->userStorageController->createEntity(array('name' => 'second_third_role')); $account->addRole('one_permission'); $account->addRole('multiple_permissions'); $account->save(); diff --git a/core/modules/user/lib/Drupal/user/UserStorageController.php b/core/modules/user/lib/Drupal/user/UserStorageController.php index a441023..2b96c11 100644 --- a/core/modules/user/lib/Drupal/user/UserStorageController.php +++ b/core/modules/user/lib/Drupal/user/UserStorageController.php @@ -61,7 +61,7 @@ public function __construct($entity_type, $entity_info, Connection $database, Pa /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $entity_info, diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php index b2669a1..bca29bb 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php @@ -82,7 +82,7 @@ public function testEntityArea() { for ($i = 0; $i < 2; $i++) { $random_label = $this->randomName(); $data = array('bundle' => 'entity_test_render', 'name' => $random_label); - $entity_test = $this->container->get('plugin.manager.entity')->getStorageController('entity_test_render')->create($data); + $entity_test = $this->container->get('plugin.manager.entity')->getStorageController('entity_test_render')->createEntity($data); $entity_test->save(); $entities[] = $entity_test; } diff --git a/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php b/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php index 8d38134..5cc1f0a 100644 --- a/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php @@ -109,17 +109,17 @@ protected function setupTestEntities() { 'name' => 'name1', ); - $this->storageController->create($entity_1)->save(); - $this->storageController->create($entity_1)->save(); - $this->storageController->create($entity_1)->save(); - $this->storageController->create($entity_1)->save(); + $this->storageController->createEntity($entity_1)->save(); + $this->storageController->createEntity($entity_1)->save(); + $this->storageController->createEntity($entity_1)->save(); + $this->storageController->createEntity($entity_1)->save(); $entity_2 = array( 'name' => 'name2', ); - $this->storageController->create($entity_2)->save(); - $this->storageController->create($entity_2)->save(); - $this->storageController->create($entity_2)->save(); + $this->storageController->createEntity($entity_2)->save(); + $this->storageController->createEntity($entity_2)->save(); + $this->storageController->createEntity($entity_2)->save(); } /** @@ -165,7 +165,7 @@ public function testGroupByCountOnlyFilters() { // Doesn't display SUM, COUNT, MAX... functions in SELECT statment for ($x = 0; $x < 10; $x++) { - $this->storageController->create(array('name' => 'name1'))->save(); + $this->storageController->createEntity(array('name' => 'name1'))->save(); } $view = views_get_view('test_group_by_in_filters'); diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php index 4a696c3..3d03d25 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php @@ -131,7 +131,7 @@ protected function loadTests() { */ protected function createTests() { // Create a new View instance with empty values. - $created = $this->controller->create(array()); + $created = $this->controller->createEntity(array()); $this->assertTrue($created instanceof View, 'Created object is a View.'); // Check that the View contains all of the properties. @@ -141,7 +141,7 @@ protected function createTests() { // Create a new View instance with config values. $values = \Drupal::config('views.view.test_view_storage')->get(); - $created = $this->controller->create($values); + $created = $this->controller->createEntity($values); $this->assertTrue($created instanceof View, 'Created object is a View.'); // Check that the View contains all of the properties. @@ -219,10 +219,10 @@ protected function displayMethodTests() { 'position' => 3 ) ); - $view = $this->controller->create($config); + $view = $this->controller->createEntity($config); // Tests Drupal\views\Plugin\Core\Entity\View::addDisplay() - $view = $this->controller->create(array()); + $view = $this->controller->createEntity(array()); $random_title = $this->randomName(); $id = $view->addDisplay('page', $random_title); @@ -242,14 +242,14 @@ protected function displayMethodTests() { // Tests Drupal\views\Plugin\Core\Entity\View::generateDisplayId(). // @todo Sadly this method is not public so it cannot be tested. - // $view = $this->controller->create(array()); + // $view = $this->controller->createEntity(array()); // $this->assertEqual($view->generateDisplayId('default'), 'default', 'The plugin ID for default is always default.'); // $this->assertEqual($view->generateDisplayId('feed'), 'feed_1', 'The generated ID for the first instance of a plugin type should have an suffix of _1.'); // $view->addDisplay('feed', 'feed title'); // $this->assertEqual($view->generateDisplayId('feed'), 'feed_2', 'The generated ID for the first instance of a plugin type should have an suffix of _2.'); // Tests Drupal\views\Plugin\Core\Entity\View::newDisplay(). - $view = $this->controller->create(array()); + $view = $this->controller->createEntity(array()); $view->newDisplay('default'); $display = $view->newDisplay('page'); @@ -270,7 +270,7 @@ protected function displayMethodTests() { $this->assertTrue($executable->displayHandlers->get('feed_1')->default_display instanceof DefaultDisplay); // Tests item related methods(). - $view = $this->controller->create(array('base_table' => 'views_test_data')); + $view = $this->controller->createEntity(array('base_table' => 'views_test_data')); $view->addDisplay('default'); $view = $view->getExecutable(); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/BreakLockForm.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/BreakLockForm.php index a161caf..b6bbca4 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/BreakLockForm.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/BreakLockForm.php @@ -49,7 +49,7 @@ public function __construct(EntityManager $entity_manager, TempStoreFactory $tem /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('plugin.manager.entity'), $container->get('user.tempstore') diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php index 4ad9376..c234d8d 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php @@ -43,7 +43,7 @@ public function __construct(ModuleHandlerInterface $module_handler, ViewsPluginM /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('plugin.manager.views.wizard') diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php index 6048d35..f1fc7f8 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -57,7 +57,7 @@ public function __construct(ModuleHandlerInterface $module_handler, TempStoreFac /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info, $operation = NULL) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info, $operation = NULL) { return new static( $container->get('module_handler'), $container->get('user.tempstore'), diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php index 8fe0ce7..cbc378a 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php @@ -31,7 +31,7 @@ class ViewListController extends ConfigEntityListController implements EntityCon /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $entity_type, $container->get('plugin.manager.entity')->getStorageController($entity_type), diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php index de4bd60..f24f9e7 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php @@ -41,7 +41,7 @@ public function __construct(ModuleHandlerInterface $module_handler, TempStoreFac /** * {@inheritdoc} */ - public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { + public static function create(ContainerInterface $container, $entity_type, array $entity_info) { return new static( $container->get('module_handler'), $container->get('user.tempstore')