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-tax
Model
ResourceModel
Calculation
Rate.php
Go to the documentation of this file.
1
<?php
12
namespace
Magento\Tax\Model\ResourceModel\Calculation
;
13
14
class
Rate
extends
\Magento\Framework\Model\ResourceModel\Db\AbstractDb
15
{
21
protected
function
_construct
()
22
{
23
$this->
_init
(
'tax_calculation_rate'
,
'tax_calculation_rate_id'
);
24
}
25
31
protected
function
_initUniqueFields
()
32
{
33
$this->_uniqueFields = [[
'field'
=> [
'code'
],
'title'
=>
__
(
'Code'
)]];
34
return
$this;
35
}
36
42
public
function
deleteAllRates
()
43
{
44
$this->
getConnection
()->delete($this->
getMainTable
());
45
return
$this;
46
}
47
54
public
function
isInRule
($rateId)
55
{
56
$connection
= $this->
getConnection
();
57
$select
=
$connection
->select()->from(
58
$this->
getTable
(
'tax_calculation'
),
59
[
'tax_calculation_rate_id'
]
60
)->where(
61
'tax_calculation_rate_id = ?'
,
62
$rateId
63
);
64
return
$connection
->fetchCol(
$select
);
65
}
66
}
Magento\Framework\Model\ResourceModel\Db\AbstractDb\getMainTable
getMainTable()
Definition:
AbstractDb.php:264
Magento\Tax\Model\ResourceModel\Calculation\Rate\deleteAllRates
deleteAllRates()
Definition:
Rate.php:42
Magento\Tax\Model\ResourceModel\Calculation\Rate\isInRule
isInRule($rateId)
Definition:
Rate.php:54
__
__()
Definition:
__.php:13
Magento\Framework\Model\ResourceModel\Db\AbstractDb\_init
_init($mainTable, $idFieldName)
Definition:
AbstractDb.php:186
Magento\Tax\Model\ResourceModel\Calculation\Rate\_construct
_construct()
Definition:
Rate.php:21
$select
$select
Definition:
catalog_rule_10_off_not_logged_rollback.php:14
Magento\Framework\Model\ResourceModel\Db\AbstractDb\getTable
getTable($tableName)
Definition:
AbstractDb.php:279
Magento\Framework\Model\ResourceModel\Db\AbstractDb
Definition:
AbstractDb.php:24
$connection
$connection
Definition:
bulk.php:13
Magento\Framework\Model\ResourceModel\Db\AbstractDb\getConnection
getConnection()
Definition:
AbstractDb.php:325
Magento\Tax\Model\ResourceModel\Calculation\Rate\_initUniqueFields
_initUniqueFields()
Definition:
Rate.php:31
Magento\Tax\Model\ResourceModel\Calculation
Magento\Tax\Model\ResourceModel\Calculation\Rate
Definition:
Rate.php:14