Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
bookmarks.php
Go to the documentation of this file.
1 <?php
8 
11  [
12  'user_id' => 1,
13  'namespace' => 'bm_namespace',
14  'identifier' => 'first',
15  'current' => 1,
16  'config' => '{}',
17  'title' => 'Bb'
18  ],
19  [
20  'user_id' => 1,
21  'namespace' => 'bm_namespace',
22  'identifier' => 'second',
23  'current' => 0,
24  'config' => '{1}',
25  'title' => 'Aa'
26  ],
27  [
28  'user_id' => 1,
29  'namespace' => 'new_namespace',
30  'identifier' => 'third',
31  'current' => 1,
32  'config' => '{}',
33  'title' => 'Default View'
34  ],
35 ];
36 
37 foreach ($bookmarks as $bookmarkData) {
39  $bookmark = $objectManager->create(BookmarkInterface::class);
40  $bookmark
41  ->setData($bookmarkData)
42  ->save();
43 }
$bookmarks
Definition: bookmarks.php:10
$objectManager
Definition: bookmarks.php:9