Skip to content

Commit 9ae54f9

Browse files
authored
Merge pull request #4 from drupalcommerce/mglaman-patch-2
Fix usages of entity_create
2 parents c11d1b4 + f683d89 commit 9ae54f9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

demo_commerce.install

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Drupal\user\Entity\User;
99
use Drupal\user\RoleInterface;
1010
use Drupal\user\UserInterface;
11+
use Drupal\shortcut\Entity\Shortcut;
1112

1213
/**
1314
* Implements hook_install().
@@ -48,15 +49,15 @@ function demo_commerce_install() {
4849
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['access shortcuts']);
4950

5051
// Populate the default shortcut set.
51-
$shortcut = entity_create('shortcut', [
52+
$shortcut = Shortcut::create([
5253
'shortcut_set' => 'default',
5354
'title' => t('Add content'),
5455
'weight' => -20,
5556
'link' => ['uri' => 'internal:/node/add'],
5657
]);
5758
$shortcut->save();
5859

59-
$shortcut = entity_create('shortcut', [
60+
$shortcut = Shortcut::create([
6061
'shortcut_set' => 'default',
6162
'title' => t('All content'),
6263
'weight' => -19,

0 commit comments

Comments
 (0)