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/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/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/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_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 4e65c9f..5d89b54 100644 --- a/core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php +++ b/core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php @@ -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 0246cfd..403b09a 100644 --- a/core/modules/field/lib/Drupal/field/FieldStorageController.php +++ b/core/modules/field/lib/Drupal/field/FieldStorageController.php @@ -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/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/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/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/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/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/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/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/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/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();