Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
integration
testsuite
Magento
Ui
_files
bookmarks.php
Go to the documentation of this file.
1
<?php
6
use
Magento\Ui\Api\Data\BookmarkInterface
;
7
use
Magento\Ui\Model\Bookmark
;
8
9
$objectManager
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
();
10
$bookmarks
= [
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
}
Magento\Ui\Api\Data\BookmarkInterface
Definition:
BookmarkInterface.php:14
$bookmarks
$bookmarks
Definition:
bookmarks.php:10
$objectManager
$objectManager
Definition:
bookmarks.php:9
Magento\Ui\Model\Bookmark
Definition:
Bookmark.php:22
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125