Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Protected Member Functions | |
_getRules (Address $address=null) | |
getAddressId (Address $address) | |
![]() | |
_construct () | |
_init ($resourceModel) | |
_setResourceModel ($resourceName, $collectionName=null) | |
_getResource () | |
_getEventData () | |
_beforeLoad ($modelId, $field=null) | |
_afterLoad () | |
_hasModelChanged () | |
_getValidatorBeforeSave () | |
_createValidatorBeforeSave () | |
_getValidationRulesBeforeSave () | |
_clearReferences () | |
_clearData () | |
![]() | |
_getData ($key) | |
_underscore ($name) | |
Protected Attributes | |
$_rules | |
$_isFirstTimeResetRun = true | |
$_rulesItemTotals = [] | |
$_skipActionsValidation = false | |
$_catalogData = null | |
$_collectionFactory | |
$validatorUtility | |
$rulesApplier | |
$priceCurrency | |
$validators | |
$messageManager | |
$counter = 0 | |
![]() | |
$_eventPrefix = 'core_abstract' | |
$_eventObject = 'object' | |
$_idFieldName = 'id' | |
$_hasDataChanges = false | |
$_origData | |
$_isDeleted = false | |
$_resource | |
$_resourceCollection | |
$_resourceName | |
$_collectionName | |
$_cacheTag = false | |
$_dataSaveAllowed = true | |
$_isObjectNew = null | |
$_validatorBeforeSave = null | |
$_eventManager | |
$_cacheManager | |
$_registry | |
$_logger | |
$_appState | |
$_actionValidator | |
$storedData = [] | |
![]() | |
$_data = [] | |
Additional Inherited Members | |
![]() | |
static | $_underscoreCache = [] |
Allows dispatching before and after events for each controller action
@method mixed getCouponCode() @method Validator setCouponCode($code) @method mixed getWebsiteId() @method Validator setWebsiteId($id) @method mixed getCustomerGroupId() @method Validator setCustomerGroupId($id) @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 25 of file Validator.php.
__construct | ( | \Magento\Framework\Model\Context | $context, |
\Magento\Framework\Registry | $registry, | ||
\Magento\SalesRule\Model\ResourceModel\Rule\CollectionFactory | $collectionFactory, | ||
\Magento\Catalog\Helper\Data | $catalogData, | ||
\Magento\SalesRule\Model\Utility | $utility, | ||
\Magento\SalesRule\Model\RulesApplier | $rulesApplier, | ||
\Magento\Framework\Pricing\PriceCurrencyInterface | $priceCurrency, | ||
\Magento\SalesRule\Model\Validator\Pool | $validators, | ||
\Magento\Framework\Message\ManagerInterface | $messageManager, | ||
\Magento\Framework\Model\ResourceModel\AbstractResource | $resource = null , |
||
\Magento\Framework\Data\Collection\AbstractDb | $resourceCollection = null , |
||
array | $data = [] |
||
) |
\Magento\Framework\Model\Context | $context | |
\Magento\Framework\Registry | $registry | |
\Magento\SalesRule\Model\ResourceModel\Rule\CollectionFactory | $collectionFactory | |
\Magento\Catalog\Helper\Data | $catalogData | |
Utility | $utility | |
RulesApplier | $rulesApplier | |
\Magento\Framework\Pricing\PriceCurrencyInterface | $priceCurrency | |
Validator\Pool | $validators | |
\Magento\Framework\Message\ManagerInterface | $messageManager | |
\Magento\Framework\Model\ResourceModel\AbstractResource | $resource | |
\Magento\Framework\Data\Collection\AbstractDb | $resourceCollection | |
array | $data | @SuppressWarnings(PHPMD.ExcessiveParameterList) |
Definition at line 115 of file Validator.php.
|
protected |
Get rules collection for current object state
Address | null | $address |
Definition at line 162 of file Validator.php.
canApplyRules | ( | AbstractItem | $item | ) |
Can apply rules check
AbstractItem | $item |
Definition at line 223 of file Validator.php.
decrementRuleItemTotalsCount | ( | $key | ) |
|
protected |
getItemBaseOriginalPrice | ( | $item | ) |
Return item base original price
AbstractItem | $item |
Definition at line 464 of file Validator.php.
getItemBasePrice | ( | $item | ) |
Return item base price
AbstractItem | $item |
Definition at line 452 of file Validator.php.
getItemOriginalPrice | ( | $item | ) |
Return item original price
AbstractItem | $item |
Definition at line 441 of file Validator.php.
getItemPrice | ( | $item | ) |
Return item price
AbstractItem | $item |
Definition at line 428 of file Validator.php.
getRuleItemTotalsInfo | ( | $key | ) |
init | ( | $websiteId, | |
$customerGroupId, | |||
$couponCode | |||
) |
Init validator Init process load collection of rules for specific website, customer group and coupon code
int | $websiteId | |
int | $customerGroupId | |
string | $couponCode |
Definition at line 149 of file Validator.php.
prepareDescription | ( | $address, | |
$separator = ' , |
|||
' | |||
) |
Convert address discount description array to string
Address | $address | |
string | $separator |
Definition at line 476 of file Validator.php.
process | ( | AbstractItem | $item | ) |
Quote item discount calculation process
AbstractItem | $item |
Definition at line 259 of file Validator.php.
processShippingAmount | ( | Address | $address | ) |
Apply discounts to shipping amount
Address | $address |
Definition at line 288 of file Validator.php.
reset | ( | Address | $address | ) |
Reset quote and address applied rules
Address | $address |
Definition at line 241 of file Validator.php.
setSkipActionsValidation | ( | $flag | ) |
Set skip actions validation flag
bool | $flag |
Definition at line 211 of file Validator.php.
|
protected |
Definition at line 61 of file Validator.php.
|
protected |
Definition at line 66 of file Validator.php.
|
protected |
Definition at line 40 of file Validator.php.
|
protected |
Definition at line 32 of file Validator.php.
|
protected |
Definition at line 47 of file Validator.php.
|
protected |
Definition at line 54 of file Validator.php.
|
protected |
Definition at line 98 of file Validator.php.
|
protected |
Definition at line 91 of file Validator.php.
|
protected |
Definition at line 81 of file Validator.php.
|
protected |
Definition at line 76 of file Validator.php.
|
protected |
Definition at line 86 of file Validator.php.
|
protected |
Definition at line 71 of file Validator.php.