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
module-quote
Model
Quote
Item
Option.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Quote\Model\Quote\Item
;
7
19
class
Option
extends
\Magento\Framework\Model\AbstractModel
implements
20
\Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface
21
{
25
protected
$_item
;
26
30
protected
$_product
;
31
37
protected
function
_construct
()
38
{
39
$this->
_init
(\
Magento
\
Quote
\Model\
ResourceModel
\
Quote
\
Item
\Option::class);
40
}
41
47
protected
function
_hasModelChanged
()
48
{
49
if
(!$this->
hasDataChanges
()) {
50
return
false
;
51
}
52
53
return
$this->
_getResource
()->hasDataChanged($this);
54
}
55
62
public
function
setItem
(
$item
)
63
{
64
$this->
setItemId
(
$item
->getId());
65
$this->_item =
$item
;
66
return
$this;
67
}
68
74
public
function
getItem
()
75
{
76
return
$this->_item
;
77
}
78
85
public
function
setProduct
(
$product
)
86
{
87
$this->setProductId(
$product
->getId());
88
$this->_product =
$product
;
89
return
$this;
90
}
91
97
public
function
getProduct
()
98
{
99
return
$this->_product
;
100
}
101
107
public
function
getValue
()
108
{
109
return
$this->
_getData
(
'value'
);
110
}
111
117
public
function
beforeSave
()
118
{
119
if
($this->
getItem
()) {
120
$this->
setItemId
($this->
getItem
()->
getId
());
121
}
122
return
parent::beforeSave();
123
}
124
130
public
function
__clone
()
131
{
132
$this->
setId
(
null
);
133
$this->_item =
null
;
134
return
$this;
135
}
136
}
Magento\Quote\Model\Quote\Item\Option\$_product
$_product
Definition:
Option.php:30
Magento\Framework\Model\AbstractModel
Definition:
AbstractModel.php:19
Magento\Quote\Model\Quote\Item\Option\setItem
setItem($item)
Definition:
Option.php:62
Magento\Quote\Model\Quote\Item\Option\_construct
_construct()
Definition:
Option.php:37
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
Magento\Framework\Model\AbstractModel\getId
getId()
Definition:
AbstractModel.php:288
Magento\Quote\Model\Quote\Item\Option\$_item
$_item
Definition:
Option.php:25
$item
$item
Definition:
partial_invoice.php:27
Magento\Framework\DataObject\_getData
_getData($key)
Definition:
DataObject.php:189
Magento\Quote\Model\Quote\Item\Option\getValue
getValue()
Definition:
Option.php:107
Magento\Quote\Model\Quote\Item
Definition:
RepositoryTest.php:6
Magento\Quote\Model\Quote\Item\Option\__clone
__clone()
Definition:
Option.php:130
Magento\Catalog\Model\Product\Option
Definition:
Option.php:32
Magento\Quote\Model\Quote\Item\Option\getProduct
getProduct()
Definition:
Option.php:97
Magento\Framework\Model\AbstractModel\hasDataChanges
hasDataChanges()
Definition:
AbstractModel.php:328
Magento\Framework\Model\AbstractModel\setId
setId($value)
Definition:
AbstractModel.php:299
Magento\Quote\Model\Quote\Item\Option\getItem
getItem()
Definition:
Option.php:74
Magento\Quote\Model\Quote\Item\setItemId
setItemId($itemID)
Definition:
Item.php:945
Magento\Framework\Model\AbstractModel\_getResource
_getResource()
Definition:
AbstractModel.php:470
Magento\Quote\Model\Quote\Address\Item
Definition:
Item.php:89
Magento\Quote\Model\Quote\Item\Option\_hasModelChanged
_hasModelChanged()
Definition:
Option.php:47
Magento
Magento\Framework\DB\Platform\Quote
Definition:
Quote.php:13
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
Magento\Quote\Model\Quote\Item\Option\setProduct
setProduct($product)
Definition:
Option.php:85
Magento\Quote\Model\Quote\Item\Option\beforeSave
beforeSave()
Definition:
Option.php:117
Magento\Framework\Model\AbstractModel\_init
_init($resourceModel)
Definition:
AbstractModel.php:213